| Author |
Jtable, Jtextarea
|
keiyia jackson
Ranch Hand
Joined: Jul 16, 2001
Posts: 49
|
|
|
i have a table and a text area in a split pane. i have it set up where if you click on a row, it appends info to the table. well, i see now that it appends it to the bottome of the current text. i am trying to use the replaceRange()method with getlineendoffset() and getlinestartoffset(). how do you use them so that it will at least compile. basically i want the text to be replaced with different text if you click on a different row.
|
 |
Paul Stevens
Ranch Hand
Joined: May 17, 2001
Posts: 2823
|
|
|
Try setText("") then load it with the new.
|
 |
keiyia jackson
Ranch Hand
Joined: Jul 16, 2001
Posts: 49
|
|
|
does it matter that it is a textarea not textfield
|
 |
Paul Stevens
Ranch Hand
Joined: May 17, 2001
Posts: 2823
|
|
|
No. They are both JTextComponents which is where the method is inherited from.
|
 |
Javaoops
Ranch Hand
Joined: Jun 21, 2001
Posts: 57
|
|
keiyia, I want to clarify whether the textarea contains text other than the selected row detail. If no, then to replace the textarea text with the current selection row detail instead of appending, on each selection of row replace the text with new selection details. textarea.setText(selected row detail); 
|
 |
keiyia jackson
Ranch Hand
Joined: Jul 16, 2001
Posts: 49
|
|
I already got it. but thanks 
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: Jtable, Jtextarea
|
|
|