• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem Regarding JTable

 
Ranch Hand
Posts: 186
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,

I ahve created a button at the bottom of a Jtable which is used to add rows.Whenever i select a cell in the table in which data is already there inside the cell and invoke ALT-A keyboard shortcut for Adding rows, the data inside the cell gets disappeared.

But if i double click the cell or click the Add rows button the data doesn't get disappeared.

Please provide your kindly help.
Thanks,
Vijay
 
Vijay Chandran
Ranch Hand
Posts: 186
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,

Please reply if the topic is not clear. Since i am a novice to Swing its diffiicult for me to get proper resources.

Kindly provide your help.

Thanks,
Vijay
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try adding this in the constructor

table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
 
Vijay Chandran
Ranch Hand
Posts: 186
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Michael,
This works fine.
But there are two more problems.

If i select two or more cells in the table and invoke ALT-A the data in the first cell gets vanished.

If i enter some data in the cell, scroll the table to the right and come back to the cell and again invoke ALT-A, the data gets disappeared in the paricular cell again. I have totally 15 columns.

Kindly provide your help.
Regards,
Vijay
reply
    Bookmark Topic Watch Topic
  • New Topic