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

cannot change JTable values at runtime  RSS feed

Bishawjit Dey
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, I am really stuck with with a JTable problem. I have made a Jtable with AbstractTableModel. The data in the table cells are numbers. I have implemented a table model listener with class declaration. Problem is, I can't change the values of the table during runtime. I tried using fireTableDataChanged(), fireTableCellUpdated() with setValueAt() method inside the tableChanged interface kind of like this

public void tableChanged (TableModelEvent t) {
int a= t.getFirstRow();
int b= t.getColumn();
Object obj = getSource();

setValueAt(obj, a, b);

but the table cell value doesnt change. I am a kind of newbie in Swing/Awt and Jtable seems to be hardest thing for me to learn. I have googled hours for an easy beginner level tutorial on jtable but couldnt find one. so I am confused as to how I should code to change the cell value. your help will be greately appreciated.
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!