🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JList only showing one selection

#8006
From: Joi Ellis [TeamB]
Date: Tue, 07 Nov 2000 06:50
22 lines
1842 bytes
Kevin Dwan <kevin@blueberry.com> wrote:


> The problem may be that the default list model of a JList is immutable,
> and I have to do something like set the JList to DefaultListModel with the
> setModel method, and then zap the choices by operating on the instance
> of the ListModel. I tried doing this using the ListModel's .clear()
> and .removeAllElements() methods, but they don't seem to work as I
> expected either.

> I didn't think it would be this difficult to just erase the list.

Ah, yes, you need to define your own AbstractDataModel and use one of the
other JList constructors.  It didn't occur to me to ask which constructor
you were using.   Have you checked Sun's tutorial pages for JList?  It
isn't really that difficult to create a model of your own.  I've made 
several at work so far.

-- 
Joi Ellis (TeamB) 
No direct email, please.
For best results, post on news server newsgroups.borland.com!
Technical Details
Message-ID: <8u88oh$2q10@bornews.inprise.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!howland.erols.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!not-for-mail
References: <3A021239.92AF1FD4@blueberry.com> <8tt9hf$kml3@bornews.borland.com> <3A0363E0.2BF1797E@blueberry.com> <8tvor2$dfj4@bornews.borland.com> <3A075600.642F986E@blueberry.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,34638f00403429f8
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2000-11-06 22:51:32 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!howland.erols.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!not-for-mail
From: "Joi Ellis [TeamB]" <joi@aravox.com>
Newsgroups: borland.public.jbuilder.java.swing
Subject: Re: JList only showing one selection
Date: 7 Nov 2000 06:50:57 GMT
Organization: Another Netscape Collabra Server User
Lines: 22
Message-ID: <8u88oh$2q10@bornews.inprise.com>
References: <3A021239.92AF1FD4@blueberry.com> <8tt9hf$kml3@bornews.borland.com> <3A0363E0.2BF1797E@blueberry.com> <8tvor2$dfj4@bornews.borland.com> <3A075600.642F986E@blueberry.com>
NNTP-Posting-Host: linux.aravox.com
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.14-5.0 (i686))