cellBackground in JTable

2001-12-07 Thread Jaime Yeckle




Hello -
Is there an easy way to set 
the background cell color forselected cell (only this cell, when is 
selected ) in a JTable .Please help me
Thanks, 
Jaime


RE: cellBackground in JTable

2001-12-07 Thread Pepelis, Aaron



just 
looks the class DefaultTableCellREnderer (I thnk that's it's 
name)
and 
there's a function in there called getComponent blah blah 
balh.
inside 
of that, you can figure out if ti's the cell that you want to have a differetn 
color and color it up differently.
remember, the defaultCellREnderer is just extended from a 
JLabel.
so you 
can do what ever youcan to a label to it.
aaron

  -Original Message-From: Jaime Yeckle 
  [mailto:[EMAIL PROTECTED]]Sent: Friday, December 07, 2001 2:53 
  PMTo: Pepelis, AaronSubject: cellBackground in 
  JTable
  Please, would you explain me how 
  make a custom cell renderer, or give me an example.
  
  Thanks in advance
  
  
- Original Message - 
From: 
Pepelis, Aaron 
To: 'Jaime Yeckle' 
Sent: Friday, December 07, 2001 3:42 
PM
Subject: RE: cellBackground in 
JTable

you have to write a custom cell renderer
aaron

  -Original Message-From: Jaime Yeckle [mailto:[EMAIL PROTECTED]]Sent: 
  Friday, December 07, 2001 2:42 PMTo: Help 
  JavaSubject: cellBackground in JTable
  
  Hello -
  Is there an easy way to 
  set the background cell color forselected cell (only this cell, 
  when is selected ) in a JTable .Please help 
  me
  Thanks, 
  Jaime