Thread View: borland.public.jbuilder.java.swing
5 messages
5 total messages
Started by Matthew Sweet
Tue, 06 Jan 2004 22:01
Dynamically Change Column Header
Author: Matthew Sweet
Date: Tue, 06 Jan 2004 22:01
Date: Tue, 06 Jan 2004 22:01
11 lines
1627 bytes
1627 bytes
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. Thanks, Matthew
Re: Dynamically Change Column Header
Author: Paul Furbacher
Date: Wed, 07 Jan 2004 16:09
Date: Wed, 07 Jan 2004 16:09
40 lines
2441 bytes
2441 bytes
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.
Re: Dynamically Change Column Header
Author: 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.
Re: Dynamically Change Column Header
Author: Matthew Sweet
Date: Wed, 07 Jan 2004 17:40
Date: Wed, 07 Jan 2004 17:40
63 lines
3097 bytes
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.
>
>
Re: Dynamically Change Column Header
Author: Paul Furbacher
Date: Wed, 07 Jan 2004 18:33
Date: Wed, 07 Jan 2004 18:33
27 lines
2077 bytes
2077 bytes
Matthew Sweet wrote:
> What is the proper call to update the change? I used
> table.getTableHeader().updateUI. It works but is there a more appropriate
> way?
When I whipped up a demo of what I suggested
in my previous post, I didn't call any update
method ... nothing more than the code given.
I did however make the selection using a
combo box.
--
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads