"tiewknvc9" <aotemp@hotmail.com> wrote in news:1136403815.801650.293660
@z14g2000cwz.googlegroups.com:
> Hi!
>
[quoted text clipped - 10 lines]
>
> Thanks
There is no JTextBox class in the standard Java API. Do you mean
JTextField?
I'm a little puzzled on why you want to use a JTextBox as renderer. The
purpose of JTextBox is to *edit* data. If you only want to show it, JLabel
is the way to go - and this is btw the default cell renderer(1). Using
JTextBox as cell editor makes more sense.
JComponent has a setBorder method which may help. But without seeing code
I can't be sure. Posting a short, complete(2) example may help.
(1) to be correct, it's a subclass of JLabel
(2) meaning it has all the classes needed to compile. See
http://mindprod.com/jgloss/sscce.html

Signature
Beware the False Authority Syndrome
tiewknvc9 - 04 Jan 2006 20:29 GMT
ok, I changed the renderer to extend jlabel instead or jtextfield.
This did work for setting the default value as well as getting rid of
the terrible grey box issue.
However, now the cells with the jlabel no longer are highlighted... I
would like to be able to keep a highlighted row to show which row the
user is working with, as well as alternate row colors.
would the jlabel renderer allow me to do this? ANy idea on the method
to use?
Thanks again
Chris Smith - 04 Jan 2006 20:57 GMT
> ok, I changed the renderer to extend jlabel instead or jtextfield.
> This did work for setting the default value as well as getting rid of
[quoted text clipped - 3 lines]
> would like to be able to keep a highlighted row to show which row the
> user is working with, as well as alternate row colors.
I get the feeling you're making things more difficult than needed.
DefaultTableCellRenderer already extends JLabel. Just subclass it, and
override getTableCellRendererComponent to first call the superclass, and
then make your changes. Then if you don't want to override the color of
a selected component, just don't change the color when isSelected is
false.

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
tiewknvc9 - 04 Jan 2006 21:07 GMT
thanks worked like a charm!