aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Problem Regarding JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem Regarding JTable" Watch "Problem Regarding JTable" New topic
Author

Problem Regarding JTable

Vijay Chandran
Ranch Hand

Joined: Jan 07, 2007
Posts: 178
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

Joined: Jan 07, 2007
Posts: 178
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
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
try adding this in the constructor

table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
Vijay Chandran
Ranch Hand

Joined: Jan 07, 2007
Posts: 178
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
 
Don't get me started about those stupid light bulbs.
 
subject: Problem Regarding JTable