Article View: borland.public.jbuilder.java.swing
Article #9327Re: Set Image to TableHeader ???
From: Rainer
Date: Fri, 14 Apr 2000 00:00
Date: Fri, 14 Apr 2000 00:00
66 lines
2235 bytes
2235 bytes
Thanks for your Help,
but now in all rows of the selected column the image will shown.
How have i to set the HeaderRenderer.
Could you help me
Thanks Rainer (Germany)
"Ernesto Bascon Pantoja" <bascone@ucbcba.edu.bo> wrote in message
news:38F38B50.B9293DBC@ucbcba.edu.bo...
> Hi:
>
> I implemented a class that extends JLabel and implements a
> TableCellRenderer.
> In this class, I did override the getTableCellRendererComponent()
> method.
> Something like this:
>
>
> class MyTableHeaderRenderer extends JLabel implements TableCellRenderer
> {
> Icon arrowUp = new ImageIcon(icon1);
> Icon arrowDown = new ImageIcon(icon2);
>
> public Component getTableCellRendererComponent(JTable table, Object
> value,
> boolean isSelected, boolean hasFocus, int
> row, int column)
> {
> setBorder(yourBorder);
> switch (column)
> {
> case -1: setIcon(null);
> setFont(yourFont1);
> break;
> default: setFont(yourFont2);
> if (order == NORMAL)
> setIcon(arrowDown);
> else
> setIcon(arrowUp);
> }
>
> setHorizontalAlignment(JLabel.CENTER);
> setText(value.toString());
> return this;
> }
> };
>
> }
>
> Saludos
>
> Ernesto B.
>
>
>
>
>
> --
> ------------------------------------------
> What you dream is what you are
>
> Polimorf's Page: http://166.114.106.63
> ------------------------------------------
Technical Details
Message-ID:
<8d6p3h$17b12@bornews.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8chrs4$jpc1@bornews.borland.com> <38F38B50.B9293DBC@ucbcba.edu.bo>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,5ec6b97b8654eea1 X-Google-Attributes: gid111d45,public From: "Rainer" <rd@ley.de> Subject: Re: Set Image to TableHeader ??? Date: 2000/04/14 Message-ID: <8d6p3h$17b12@bornews.borland.com> X-Deja-AN: 611047939 References: <8chrs4$jpc1@bornews.borland.com> <38F38B50.B9293DBC@ucbcba.edu.bo> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Reply-To: "Rainer" <rd@ley.de> Newsgroups: borland.public.jbuilder.java.swing