• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

JtextArea and JTable----Urgent

Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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!
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic