Article View: borland.public.jbuilder.java.swing
Article #1325Re: Dynamically Change Column Header
From: Matthew Sweet
Date: Wed, 07 Jan 2004 16:30
Date: Wed, 07 Jan 2004 16:30
50 lines
2605 bytes
2605 bytes
Man, I've been looking at this stuff too long. That was too easy. :)
Thanks.
"Paul Furbacher" <pfurbacher@mac.com> wrote in message
news:3ffc2f41$1@newsgroups.borland.com...
> Matthew Sweet wrote:
>
> > I would like to be able to change a column name in the table header by
> > selecting the name from a group of radio buttons. Is there some sort of
> > simple interface that I can get to like setColumnHeaderat(whatever) from
an
> > event to change the name of a column header. I've played around with the
> > examples I've obtained from my last post "Combo Box in Table header" but
ran
> > into look and feel issues (among some others) and just basically want to
be
> > able to push a button and Bam! my particular column header text is
changed
> > to something else.
>
> Add ActionListeners to the radio buttons which
> all point to a single method:
>
> void actionPerformed(ActionEvent e) {
>
> // based on the value of "e", get the
> // desiredHeaderName
>
> table.getColumnModel()
> .getColumn(index)
> .setHeaderValue(desiredHeaderName);
> }
>
>
>
> --
>
>
> Paul Furbacher (TeamB)
>
> Save time, search the archives:
> http://www.borland.com/newsgroups/ngsearch.html
>
> Is it in Joi Ellis's Faq-O-Matic?
> http://www.visi.com/~gyles19/fom-serve/cache/1.html
>
> Finally, please send responses to the newsgroup only.
> That means, do not send email directly to me.
> Thank you.
Technical Details
Message-ID:
<3ffc34ac$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3ffb30ed$1@newsgroups.borland.com> <3ffc2f41$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,e6d889a033380a3b X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2004-01-07 08:39:42 PST Reply-To: "Matthew Sweet" <matthew.sweet@sed.redstone.army.mil> From: "Matthew Sweet" <matthew.sweet@sed.redstone.army.mil> Newsgroups: borland.public.jbuilder.java.swing References: <3ffb30ed$1@newsgroups.borland.com> <3ffc2f41$1@newsgroups.borland.com> Subject: Re: Dynamically Change Column Header Date: Wed, 7 Jan 2004 10:30:25 -0600 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 136.205.145.26 Message-ID: <3ffc34ac$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1073493164 136.205.145.26 (7 Jan 2004 08:32:44 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail