Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Peculiar JTable issue - Cell value vanishes  RSS feed

 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am facing some peculiar issue with JTable.

Change value of a cell, without clicking on anywhere else, directly click on column (or) try to expand column size, value you entered in that cell vanishes. But if you click on any other cell instead of expanding column size, value will remain in cell. Not really sure how to fix this issue. I am clueless Please suggest.



Thanks,
Ravi
 
K. Tsang
Bartender
Posts: 3628
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code looks fine. Runs fine without cell value vanishing.

When you mean column resizing, you meant changing the width right? Because if you change a value without returning (click enter) and resize the column, the old value remains (not disappear or vanish).
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just click on any column directly from the editing cell. Don't click on any other cell.

Please find the attached screenshots.

1)Edit the value in cell, without doing anything else, click on any column.

2)If click on any column, you can see in 2.png screenshot “my message” has disappeared

3)But If you click on any other cell, the value “my message” retains as in 3.png
1.png
[Thumbnail for 1.png]
Edit the value in cell, without doing anything else, click on any column.
2.png
[Thumbnail for 2.png]
If click on any column, you can see in below screenshot “my message” has disappeared
3.png
[Thumbnail for 3.png]
But If you click on any other cell, the value “my message” retains as below:
 
Rob Camick
Ranch Hand
Posts: 2754
12
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code also works fine for me. I am using JDK7_19 on Windows 7. Maybe this is a version/platform issue?

Check out Table Stop Editing for a possible solution.

 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent!!! Thanks Rob. Link you provide is spot on.

This worked perfectly fine.

 
K. Tsang
Bartender
Posts: 3628
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way I used Java 6 u65. Maybe it's a Java 7 effect.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!