This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

about TableModelListener  RSS feed

 
mohamed abdo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have jcombobox in jtable when state changed i submit avalue in another column in the table ,and i made TableModelListener on the table when the value changed in that column i make some processing on that value , the problem is in when state changed of the combo and set the value TableModelListener not work and didnt feel any change

pease help me to find solution
 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not need to add an ItemListener to the combo box. The JTable will automatically update the TableModel when you select a value from the combo box.

I have no idea what you might be doing wrong. Read the JTable API and follow the link to the Swing tutorial on "How to Use Tables" for a working example of a table using a combo box. Then just add your TableModelListener to the code.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!