🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: how to do a JList filled with JCheckboxes?

#1069
From: George
Date: Wed, 05 May 2004 13:38
41 lines
2173 bytes
After a good night's sleep I realize your question was addressed to swing
gurus.  You will surely excuse my impetuousness. :-)


"George" <geo_54321@yahoo.com> wrote in message
news:409810e5$1@newsgroups.borland.com...
> You can implement your own javax.swing.ListCellRenderer for the JList and
> implement the getListCellRendererComponent method to return a check box.
The
> check box comes with its own label (see setText() method); so you don't
need
> to handle that separately.
>
> ListCellRender is an interface.  DefaultListCellRenderer is a concrete
class
> that extends JLabel.
>
> HTH.
>
> "Sam Seaborn" <sam@rightclick.ca> wrote in message
> news:40980aed$1@newsgroups.borland.com...
> > Hi,
> >
> > I'm trying to do a JList of JCheckboxes (like in JBX's 'close projects'
> > dialog box).
> >
> > I have implemented a JTable with two columns, one for the checkbox and
one
> > for the label.  But it's not exactly what I want, and not as nice as
> JBX's.
> >
> > Also, I tried dynamically GridBagLayout-ing JCheckBoxes on a JPanel to
> > duplicate the behaviour, but that turned out even worse.
> >
> > How would you Swing gurus do it?
> >
> > Sam
> >
> >
>
>
Technical Details
Message-ID: <4098edf8$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!easynews.net!newsfeed3.easynews.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40980aed$1@newsgroups.borland.com> <409810e5$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,e278b4d50586b83
X-Google-Attributes: gid111d45,public
From: "George" <geo_54321@yahoo.com>
Newsgroups: borland.public.jbuilder.java.swing
References: <40980aed$1@newsgroups.borland.com> <409810e5$1@newsgroups.borland.com>
Subject: Re: how to do a JList filled with JCheckboxes?
Date: Wed, 5 May 2004 09:38:31 -0400
Lines: 43
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: 63.119.115.129
Message-ID: <4098edf8$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1083764216 63.119.115.129 (5 May 2004 06:36:56 -0700)
Path: arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!easynews.net!newsfeed3.easynews.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail