• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

JTable Cell Editor Problem

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jTable1.setFocusable(false);
may help u
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic