Article View: borland.public.jbuilder.java.swing
Article #13087Re: JList with scrollbar
From: Richard Fletcher
Date: Fri, 18 Sep 1998 00:00
Date: Fri, 18 Sep 1998 00:00
53 lines
1911 bytes
1911 bytes
I've followed this thread to no avail. The Jlist box comes in perfectly but the scroll bar never comes gets displayed. Can anyone help. Thanks. JList jListLineItems = new JList(model1); JScrollPane jScrollPaneLineItems = new JScrollPane(); jScrollPaneLineItems.getViewport().setView(jListLineItems); Method to load Jlist box load up list box jListLineItems.validate(); jScrollPaneLineItems.repaint() ; Thanks Richard Fletcher Martin Anders wrote in message <35E57705.BFAD6B6C@ddsynergy.de>... >Hi Alex, > >Vladimir gave me the right hint, after you added a new element to a list you have to >call the revalidate method: > >myList.revalidate(); > >You don't even have to call a firexxxx function() the revalidate() method adds and >removes a scrollbar when needed, and shows new list entries. Thanx Vladimir. > >Martin > > >Vladimir Olenin wrote: > >> Hi, Alex, >> >> Actually, Martin gave u really good advice. Most of swing components do >> not update their contents automatically. So, try do the following: >> invalidate(), validate(), repaint(). But almost for sure u should call >> some of firexxx() functions to let JList know it'd be repainted. This >> works with JTable. >> >> Vladimir >> > > >
Technical Details
Message-ID:
<6tul1m$bqm12@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<35E2A7B4.B5EC3479@cimag.de> <35E2F53B.2269C0AA@csi.com> <35E3D07E.FA559753@cimag.de> <35E3EB20.E51998A5@ddsynergy.de> <35E4906C.71069691@hempseed.com> <35E57705.BFAD6B6C@ddsynergy.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: "Richard Fletcher" <fletcher@ecrc.org> Subject: Re: JList with scrollbar Date: 1998/09/18 Message-ID: <6tul1m$bqm12@forums.borland.com> X-Deja-AN: 392546247 References: <35E2A7B4.B5EC3479@cimag.de> <35E2F53B.2269C0AA@csi.com> <35E3D07E.FA559753@cimag.de> <35E3EB20.E51998A5@ddsynergy.de> <35E4906C.71069691@hempseed.com> <35E57705.BFAD6B6C@ddsynergy.de> X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: CTC Newsgroups: borland.public.jbuilder.java.swing