• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to put the text in The JTable cells?

Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here i am able to edit the text in JTable and able to change the text,but when the cell lost focus the old text is placed and the new entry goes away.I am using abstract table model..can any body can help me in solving it??
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe you'll need to use the stopCellEditing method on the TableCellEditor interface. Something like this in your FocusEvent method:
TableCellEditor editor = table.getCellEditor();
if (editor != null)
From the API:
public boolean stopCellEditing()
Tell the editor to stop editing and accept any partially edited value as the value of the editor. The editor returns false if editing was not stopped, useful for editors which validates and can not accept invalid entries.
true if editing was stopped

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic