File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JtextArea and JTable----Urgent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JtextArea and JTable----Urgent" Watch "JtextArea and JTable----Urgent" New topic
Author

JtextArea and JTable----Urgent

Sumeet Anand
Greenhorn

Joined: Nov 16, 2002
Posts: 16
Hi Buddies,
I am new to Java but have been actively working for past few days on GUI development stuff.
I have problems with event handling.There is a Jtable which is populated with data from Sybase.and in the last column there is a checkbox.
When a particular row in Jtable is selected the comment in Textarea (Comment field)gets populated if there is any data stored in database for that record.
Now when the checkbox is checked the comment field should become editable and a comment should be entered for the first row checked .After this when subsequently any row is checked this comment should appear automatically for that checked row and if the row is unchecked the comment that was previously present in the database should appear.
Now the problem is whenever i check the checkbox the comment field becomes editable with the record from the database.and if i update it and check another row the other row is not showing the same comment and when i come back to the row for which i updated for that also that comment is lost.
PLease suggest a way out of this problem.
Thanks in advance.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

"Java Greenhorn" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

It sounds like you are clearing the text area when you start editing when you should be applying the previous text value. Search for any setText( "" ); calls on the text area...

Thanks! and welcome to the JavaRanch!


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JtextArea and JTable----Urgent