|
-
August 19th, 1999, 01:15 AM
#1
How to set the background of a cell of a JTable
Hai friends,
I want to set the background color of some cells( not selected cells) of the JTable. How to do this?
from
Ramu
I a
-
August 22nd, 1999, 11:17 AM
#2
Re: How to set the background of a cell of a JTable
If the color of all the cells the problem is very simple, just set its background color and possibly 'setOpaque(true)'.
If u want diff color for each cell, u will need to keep the color of cell alongwith the cell value. And creating a simple CellRenderer will show the background color of that cell to specified color. This cell renderer can be just a JLabel having code to set the text (value of cell) and the background color (color of cell). Do setOpaque(true) so that JLabel will paint background.
- UnicMan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|