Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Knute Johnson Newsgroups: comp.lang.java.gui Subject: Re: Setting JList size Date: Tue, 07 Feb 2012 10:13:54 -0800 Organization: A noiseless patient Spider Lines: 30 Message-ID: References: <3365e0a4-b13f-4c2c-a2d8-8c31a9663593@x6g2000pbk.googlegroups.com> <7bb59e90-d1a1-4d8b-be68-1b369ce49d77@v6g2000pba.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 7 Feb 2012 18:13:54 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="mz/LDSJwiWnk3Jnnqg7x+Q"; logging-data="23565"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RHzbTTVRBdMKbVuqymD40" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0) Gecko/20120129 Thunderbird/10.0 In-Reply-To: <7bb59e90-d1a1-4d8b-be68-1b369ce49d77@v6g2000pba.googlegroups.com> Cancel-Lock: sha1:TCkcQpUOsdpgkt4tAdTmS7TMjFQ= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:4991 On 2/2/2012 1:29 PM, Fred wrote: > On Feb 2, 9:08 am, Knute Johnson wrote: >> On 2/2/2012 8:10 AM, 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? >>> -- >>> Fred K >> >> 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. > -- > Fred K I'm pretty sure it dates to 1.3 or earlier. -- Knute Johnson