🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #1326

Re: Dynamically Change Column Header

#1326
From: Matthew Sweet
Date: Wed, 07 Jan 2004 17:40
63 lines
3097 bytes
What is the proper call to update the change? I used
table.getTableHeader().updateUI. It works but is there a more appropriate
way?

"Matthew Sweet" <matthew.sweet@sed.redstone.army.mil> wrote in message
news:3ffc34ac$1@newsgroups.borland.com...
> 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: <3ffc4505@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!c03.atl99!news.webusenet.com!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
References: <3ffb30ed$1@newsgroups.borland.com> <3ffc2f41$1@newsgroups.borland.com> <3ffc34ac$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 10:10:24 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> <3ffc34ac$1@newsgroups.borland.com>
Subject: Re: Dynamically Change Column Header
Date: Wed, 7 Jan 2004 11:40:12 -0600
Lines: 65
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: <3ffc4505@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1073497349 136.205.145.26 (7 Jan 2004 09:42:29 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!c03.atl99!news.webusenet.com!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