This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads 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: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Override setValueAt for your table model.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!