This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JTable Cell Editor Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable Cell Editor Problem" Watch "JTable Cell Editor Problem" New topic
Author

JTable Cell Editor Problem

sachin pathak
Greenhorn

Joined: Jun 05, 2002
Posts: 27
I have created a TextField (NumericTextField) component which allows only numbers to bt typed in. Using this component I have created a TAbleEditorComponent (EvenNumberEditor) which allows only even numbers to be entered. I install EvenNumberEditor as a default editor for a testTable componenet which extends JTable.

This code is supposed to allow entry of only characters when the editing starts in the first column (0th) of the JTable. Evrything works fine if you properly invoke editing by either pressing f2 or by double-clicking on the Table Cell.

But problem arises when cell has focus, but editubg has not started and user starts typing directly. The NumericTextField seems to be not working. The TableCellEditor invoked is not using the NumericTextField component. User can type even text also for the field.



Can somebody please help out ??

Thanks in advance
Sachin
luo ware
Greenhorn

Joined: Oct 12, 2004
Posts: 2
jTable1.setFocusable(false);
may help u
 
Have you checked out Aspose?
 
subject: JTable Cell Editor Problem
 
It's not a secret anymore!