🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JList with scrollbar

#13249
From: Martin Anders
Date: Tue, 25 Aug 1998 00:00
29 lines
1013 bytes
Hi,

try this:

Jlist list = new JList();
JScrollPane scroll = new JScrollPane();
scroll.getViewport().setView(list);

that should work.

Martin



zimmerer wrote:

> Does anybody out there knows how to add a scrollbar to a JList??
> I've tried the follow:
>
> JList list = new JList();
> JScrollPane scroll = new JScrollPane(list);
>
> .......nothing happens, no scrollbar at all even I've added 1000 items
> to the box.
> Can anyone HELP me!
>
> thx.
>
> alex
Technical Details
Message-ID: <35E2F53B.2269C0AA@csi.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <35E2A7B4.B5EC3479@cimag.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,b5ee876fbd119f83
X-Google-Attributes: gid111d45,public
From: Martin Anders <MartinAnders@csi.com>
Subject: Re: JList with scrollbar
Date: 1998/08/25
Message-ID: <35E2F53B.2269C0AA@csi.com>
X-Deja-AN: 384621879
Content-Transfer-Encoding: 7bit
References: <35E2A7B4.B5EC3479@cimag.de>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing