Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Restrict editable jTable cells except for top row  RSS feed

 
Viktoria Silver
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I am developing a SWING application in JDeveloper11.

There is a jTable that needs to be enabled for edit by the user.

The real critical thing is that user must only be able to insert positive doubles or natural numbers (zero accepted) in all editable cells (a few are set to be non-editable), except for the top row. He should be able to insert whatever he likes in the top row- it's a description, not to be used for calculations. How can I solve this?

Thanks, any help appreciated!
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Override setValueAt for your table model.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!