• 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

Peculiar JTable issue - Cell value vanishes

 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Rancher
Posts: 3324
32
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Excellent!!! Thanks Rob. Link you provide is spot on.

This worked perfectly fine.

 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By the way I used Java 6 u65. Maybe it's a Java 7 effect.
 
reply
    Bookmark Topic Watch Topic
  • New Topic