• Post Reply Bookmark Topic Watch Topic
  • New Topic

AbstractTableModel  RSS feed

 
Vu Pham
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm having a small issue with AbstractTableModel.

I overwrite the getColumnClass()

{

...

if (col == 4) {
return BigDecimal.class;
}
...

}


And then when I enter a character into any cells of that column, that cell will have a red color (automatically, Java supports that?). I want to show a message if they enter something wrong like that. But I dont know which function I need to overwrite.

I try to overwrite setValueAt(Object, row, col) function, but it seems that that function doesn't run when they enter a wrong value.

Please help me if you know that, thanks very much
 
Daesung Park
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you omit fireTableCellUpdated() in overrided method? The following link may help.
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#validtext
 
Vu Pham
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!