File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Java SE 8 for the Really Impatient
this week in the
Swing / AWT / SWT
Verify input in jTable except for head row
Joined: Jul 01, 2010
Aug 25, 2010 04:28:18
I have a jTable with doubles or integers in every cell except for the top row, which can be user changed too, but can contain anything.
How can I validate user input for it being a numeric value?
I know there is an approach like this:
but if I use this on every column the top row will be restricted to.
Maybe there there is a way for validating rows instead of columns?
Thank you, all help appreciated!
Joined: Jun 13, 2009
Aug 25, 2010 08:28:27
Override the table method getCellEditor(...). If the row is 0, return a default editor otherwise return super.getCellEditor()
I agree. Here's the link:
subject: Verify input in jTable except for head row
Restrict editable jTable cells except for top row
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014