• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to make JTable editable

 
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: 2699
10
  • 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....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!