If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Text selection in a JTextArea

Hi,

I am using a JTextArea to load a document, and I want to let users to select
text, not by document flow, but by rows and columns (e.g. by dragging from
the left-upper to the right-lower corner of a region) It would work kind
of like a spreadsheet. Is such possible?

Re: Text selection in a JTextArea

You'll notice that JTextArea's getSelectedText() method returns a String.
Not an array of Strings, which is what you would need. Anyway, I don't
understand how your proposal would work with a non-fixed-width font, where
you don't have columns of letters.

But of course the answer to your question is not "No". It's "Sure, go ahead
and write a subclass of JTextArea that does what you want."

PC2

Kit <khsu@treev.com> wrote in message news:3a883801$1@news.devx.com...
>
> Hi,
>
> I am using a JTextArea to load a document, and I want to let users to
select
> text, not by document flow, but by rows and columns (e.g. by dragging from
> the left-upper to the right-lower corner of a region) It would work kind
> of like a spreadsheet. Is such possible?
>
> Kit Hsu
> khsu@treev.com