• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

problem in colors of cells JTable (check this one)

Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Problem is.
I have a JTable with 2 columns ( Rows can be 1-10 depending upon the size of
input vector)
I have provided two button in my Frame
1)Update Row
2) Update whole Table.
Now i want I want that if a user makes a change in any cell say cell( row
3,Col 1) ;and moves to next row , then the color (background/foreground) of
that cell should change to any other color .Again if he presses any of the
button then the default color of the cell should be restored.Basically i
want to indicate the user that he has made changes in the cell and he needs
to press the button for updation
Now i have wriiten code as

but the problem is that when i click the button the background of cell is not changed from red to
blue. In the action lperformed events of button i have made edited as false.
Md Aminur Rashid
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a thought, but since the object is to alert the user to changes. Why not just start with the update button not enabled and when any cell is changed enable it?
You had your fun. Now it's time to go to jail. Thanks for your help tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic