Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.gui Subject: Re: Setting JList size Date: Tue, 7 Feb 2012 11:13:46 -0800 (PST) Organization: http://groups.google.com Lines: 29 Message-ID: <24093713.118.1328642026222.JavaMail.geo-discussion-forums@pblj10> References: <3365e0a4-b13f-4c2c-a2d8-8c31a9663593@x6g2000pbk.googlegroups.com> <7bb59e90-d1a1-4d8b-be68-1b369ce49d77@v6g2000pba.googlegroups.com> Reply-To: comp.lang.java.gui@googlegroups.com NNTP-Posting-Host: 173.164.137.214 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1328642499 11993 127.0.0.1 (7 Feb 2012 19:21:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 7 Feb 2012 19:21:39 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:4993 Knute Johnson wrote: > Fred wrote: > > Knute Johnson wrote: > >> Fred wrote: > >>> I have a JList inside a JScrollPane. This list has many items in it; I > >>> want to set its height such that five of the items are visible (items > >>> are just strings). > >> > >>> This is quite trivial using C and Motif - just set the list's > >>> XmNvisibleItemCount resource. How do I do this for a JList such that > >>> if I change the font later the list resizes to still displays five > >>> items? > >> The docs are your friend. Take a look at JList.setVisibleRowCount(). > >> > > Interesting - I had made a local copy of the javadocs (I often work > > disconnected from the internet), and there is no such method listed in > > my copy! > > > > Not sure where I got my copy - I've had it for several years. > I'm pretty sure it dates to 1.3 or earlier. Indicating that Fred's copy must date back even earlier, perhaps to 1.1 before Swing was part of Java. Fred, you really do need to stay current. There've been a Nawful lot of changes since 1.1. -- Lew