🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #15704

Re: JScrollPane Help

#15704
From: Andrew G. Lader
Date: Thu, 13 May 1999 00:00
87 lines
4340 bytes
That was it.  I add a DefaultListModel in the beginning and then add
elements to it later on.  Then the scrollbars appear naturally.  I was just
calling setListData() off of the JList component.  Thanks!
Linda Licari <llicari@my-dejanews.com> wrote in message
news:7h9j6j$61i$1@nnrp1.deja.com...
> I believe the problem you are experiencing is due to the fact that the
> viewport (when you first instatiate the scrollpane) is smaller than the
> scroll pane thus no scroll bars appear. Your model needs to listen for
> changes by using ListDataListener.
>
> Hope this helps,
>
> linda
>
> In article <vSWZ2.8833$u34.3780@news.rdc1.md.home.com>,
>   "Andrew G. Lader" <lader@~nospam~home.com> wrote:
> > This is a multi-part message in MIME format.
> >
> > ------=_NextPart_000_0044_01BE9B96.685911E0
> > Content-Type: text/plain;
> > charset="Windows-1252"
> > Content-Transfer-Encoding: quoted-printable
> >
> > I have a JList within a JScrollPane.  When I fill the list while still
> =
> > in the app's constructor, I get a listbox with the appropriate =
> > scrollbars.  Perfect.
> >
> > But when I do not fill the list box in the constructor, and fill it =
> > instead when the user selects a particular menu command, the
> scrollbars =
> > do not appear.  The list can be dragged-scrolled, but it looks awful!
> =
> > Why does it exhibit this behavior?  What is the magic method I need to
> =
> > call to let the scroll pane know that I have list items now?
> >
> > Any help will be greatly appreciated (I feel like I have spent too
> much =
> > time on this already).  Thanks in advance...
> >
> > ------=_NextPart_000_0044_01BE9B96.685911E0
> > Content-Type: text/html;
> > charset="Windows-1252"
> > Content-Transfer-Encoding: quoted-printable
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML><HEAD>
> > <META content=3D"text/html; charset=3Dwindows-1252" =
> > http-equiv=3DContent-Type>
> > <META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
> > <STYLE></STYLE>
> > </HEAD>
> > <BODY bgColor=3D#ffffff>
> > <DIV>I have a JList within a JScrollPane.&nbsp; When I fill the list =
> > while still=20
> > in the app's constructor, I get a listbox with the appropriate =
> > scrollbars.&nbsp;=20
> > Perfect.</DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV><FONT face=3DTahoma>But when I do not fill the list box in the =
> > constructor,=20
> > and fill it instead when the user selects a particular menu command,
> the =
> >
> > scrollbars do not appear.&nbsp; The list can be dragged-scrolled, but
> it =
> > looks=20
> > awful!&nbsp; Why does it exhibit this behavior?&nbsp; What is the
> magic =
> > method I=20
> > need to call to let the scroll pane know that I have list items=20
> > now?</FONT></DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV><FONT face=3DTahoma>Any help will be greatly appreciated (I feel
> =
> > like I have=20
> > spent too much time on this already).&nbsp; Thanks in=20
> > advance...</FONT></DIV></BODY></HTML>
> >
> > ------=_NextPart_000_0044_01BE9B96.685911E0--
> >
> >
>
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> ---Share what you know. Learn what you don't.---
Technical Details
Message-ID: <jMo_2.10911$u34.4285@news.rdc1.md.home.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <vSWZ2.8833$u34.3780@news.rdc1.md.home.com> <7h9j6j$61i$1@nnrp1.deja.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10fd6d,59b2be28f29bfe66
X-Google-Attributes: gid10fd6d,public
X-Google-Thread: fa010,59b2be28f29bfe66
X-Google-Attributes: gidfa010,public
X-Google-Thread: 10a146,59b2be28f29bfe66
X-Google-Attributes: gid10a146,public
X-Google-Thread: f74b3,59b2be28f29bfe66
X-Google-Attributes: gidf74b3,public
From: "Andrew G. Lader" <lader@~nospam~home.com>
Subject: Re: JScrollPane Help
Date: 1999/05/13
Message-ID: <jMo_2.10911$u34.4285@news.rdc1.md.home.com>
X-Deja-AN: 477218748
References: <vSWZ2.8833$u34.3780@news.rdc1.md.home.com> <7h9j6j$61i$1@nnrp1.deja.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-Complaints-To: abuse@home.net
X-Trace: news.rdc1.md.home.com 926554255 24.3.62.64 (Wed, 12 May 1999 17:10:55 PDT)
Organization: @Home Network
X-MSMail-Priority: Normal
Reply-To: "Andrew G. Lader" <lader@~nospam~home.com>
NNTP-Posting-Date: Wed, 12 May 1999 17:10:55 PDT
Newsgroups: borland.public.jbuilder.java.language,comp.lang.java.gui,comp.lang.java.programmer,symantec.support.devtools.pc.visual-cafe.java