Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to make JTable editable  RSS feed

 
lape show
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please how can I make my JTable editable, get to know when user changes the data, and retrieve the new info into my database
 
Rob Camick
Ranch Hand
Posts: 2753
11
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please how can I make my JTable editable,


Override the isCellEditable(....) method of JTable (or the TableModel).

get to know when user changes the data


Add a TableModelListener to the TableModel

and retrieve the new info into my database


Use the tableModel.getValueAt(...) method to get the data and then write your SQL to update your database.
 
lape show
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks....
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!