Board index » jbuilder » change the color of the cell of JTable

change the color of the cell of JTable


2003-07-09 05:48:47 PM
jbuilder1
Hi there,
I want to validate Jtable for the data entry by the users.
I want to change the color of the cell (or border of cell) where data is
invalid.
can anybody suggest some thoughts on this.
thanks & regards,
Tanul
--
have a nice day :-))
www.geocities.com/ktanul
 
 

Re:change the color of the cell of JTable

"Tanul" < XXXX@XXXXX.COM >wrote in message
Quote
I want to validate Jtable for the data entry by the users.
I want to change the color of the cell (or border of cell) where data
is
invalid.
You'll need to write a custom TableCellRenderer class that draws with a
red background (or border) for invalid data.
--
Gillmer J. Derge [TeamB]
 

Re:change the color of the cell of JTable

Gillmer J. Derge [TeamB] wrote:
Quote

You'll need to write a custom TableCellRenderer class that draws with a
red background (or border) for invalid data.

could u please elaborate ur thoughts? I am really in need of this.
thanks,
Tanul
--
have a nice day :-))
www.geocities.com/ktanul
 

{smallsort}

Re:change the color of the cell of JTable

Tanul wrote:
Quote
Gillmer J. Derge [TeamB] wrote:
>
>You'll need to write a custom TableCellRenderer class that draws with a
>red background (or border) for invalid data.
>

could u please elaborate ur thoughts? I am really in need of this.


thanks,
Tanul

Look on the javasoft site. They have a really ggod and indepth article about
modifying JTables, It would be too lengthy to post here (of course Gilmer
is free to do so if he wishes <G>).
Try here
developer.java.sun.com/developer/Books/swing2/chapter18-01.html