Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom tablemodel - works in 1.2.2 not in 1.3  RSS feed

Ram KumarS
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a custom tablemodel, which has it data as a vector of Vectors of my custom datatypes. The custom datatypes are there to keep the old and new values of the table. This was developed in jdk1.2.2 and works fine there.
However when I tried a sample application in jdk1.3 (as a prelude to migrating the entire application to 1.3) I found that when I attach my custom tablemodel to a JTable, none of the cells are editable.
In the "Swing Changes and New Features for Java 2 SDK, Standard Edition, v 1.3" document, it says "Because JTable's default text editor is now smarter about data types, it now gives setValueAt objects of the appropriate type, instead of always specifying strings. For example, if setValueAt is invoked for an Integer cell, then the value is specified as an Integer instead of a String. If you implemented a table model, then you might have to change its setValueAt method to take the new data type into account. "
I programmatically used setValueAt without any problems.
Also the document says
"If you implemented a class used as a data type for cells, make sure that your class has a constructor that takes a single String argument".
I also tried adding a constructor with single String argument for all the custom dataypes but still it was not editable in the JTable.
Has anyone else encountered this problem? How to solve it?
Thanks in Advance,
email me at
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!