File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem Regarding JTable

 
Vijay Chandran
Ranch Hand
Posts: 186
Java
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try adding this in the constructor

table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
 
Vijay Chandran
Ranch Hand
Posts: 186
Java
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic