This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes problem in colors of cells JTable (check this one) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "problem in colors of cells JTable (check this one)" Watch "problem in colors of cells JTable (check this one)" New topic
Author

problem in colors of cells JTable (check this one)

aminur rashid
Ranch Hand

Joined: Sep 21, 2001
Posts: 79
Hi.
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.
Regards
Md Aminur Rashid
Pune

Regards<br />Aminur
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
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?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem in colors of cells JTable (check this one)
 
Similar Threads
Date in JTable
JTable numeric validation
jtable alert
problem in colors of cells JTable
Help updating cells in a JTable