Article View: borland.public.jbuilder.java.language
Article #14918Re: How to set custom font or foreground/background color for a grid cell?
From: Santichai Emyoo
Date: Sun, 18 Jul 1999 00:00
Date: Sun, 18 Jul 1999 00:00
42 lines
2001 bytes
2001 bytes
Thank you very much for your assistance.
But the cell I would like to control here belongs Borland's GridControl.
Sorry, not giving you the enough info.
Thanks.
Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no> wrote in message
news:uiu7mdxn2.fsf@sds.no...
> "Santichai Emyoo" <semyoo@access.inet.co.th> writes:
>
> > I need to set custom font or foreground/background color for a grid
cell,
> > only one cell, in the grid.
>
> public class MySpecialCellRenderer extends
> javax.swing.table.DefaultTableCellRenderer {
>
> public int x,y;
>
> public MySpecialCellRenderer(int _x, int _y) {
> x = _x;
> y = _y;
> }
>
> public Component getTableCellRendererComponent(JTable table,
> Object value,
> boolean isSelected,
> boolean hasFocus,
> int row,
> int column) {
> if (row == y && column == x) {
> // Do the special modifications here
> return this;
> }
> else
> return super.getTableCellRendererComponent(table, value,
> isSelected hasFocus,
> row, column);
> }
>
> }
Technical Details
Message-ID:
<7mr4q0$bi22@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7mii6u$35a9@forums.borland.com> <uiu7mdxn2.fsf@sds.no>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,2cdcc7ed8282b923 X-Google-Attributes: gidf74b3,public From: "Santichai Emyoo" <semyoo@access.inet.co.th> Subject: Re: How to set custom font or foreground/background color for a grid cell? Date: 1999/07/18 Message-ID: <7mr4q0$bi22@forums.borland.com> X-Deja-AN: 502231885 References: <7mii6u$35a9@forums.borland.com> <uiu7mdxn2.fsf@sds.no> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.language