Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #4991

Re: Setting JList size

From Knute Johnson <nospam@knutejohnson.com>
Newsgroups comp.lang.java.gui
Subject Re: Setting JList size
Date 2012-02-07 10:13 -0800
Organization A noiseless patient Spider
Message-ID <jgrpl2$n0d$1@dont-email.me> (permalink)
References <3365e0a4-b13f-4c2c-a2d8-8c31a9663593@x6g2000pbk.googlegroups.com> <jgeftr$bn1$1@dont-email.me> <7bb59e90-d1a1-4d8b-be68-1b369ce49d77@v6g2000pba.googlegroups.com>

Show all headers | View raw


On 2/2/2012 1:29 PM, Fred wrote:
> On Feb 2, 9:08 am, Knute Johnson<nos...@knutejohnson.com>  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

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Setting JList size Fred <fred.l.kleinschmidt@gmail.com> - 2012-02-02 08:10 -0800
  Re: Setting JList size Knute Johnson <nospam@knutejohnson.com> - 2012-02-02 09:08 -0800
    Re: Setting JList size Fred <fred.l.kleinschmidt@gmail.com> - 2012-02-02 13:29 -0800
      Re: Setting JList size Lew <lewbloch@gmail.com> - 2012-02-05 00:50 -0800
      Re: Setting JList size Knute Johnson <nospam@knutejohnson.com> - 2012-02-07 10:13 -0800
        Re: Setting JList size Lew <lewbloch@gmail.com> - 2012-02-07 11:13 -0800
  Re: Setting JList size Jeff Higgins <jeff@invalid.invalid> - 2012-02-02 12:13 -0500
    Re: Setting JList size Jeff Higgins <jeff@invalid.invalid> - 2012-02-02 16:09 -0500
      Re: Setting JList size markspace <-@.> - 2012-02-02 13:51 -0800
        Re: Setting JList size Jeff Higgins <jeff@invalid.invalid> - 2012-02-02 17:27 -0500
          Re: Setting JList size "John B. Matthews" <nospam@nospam.invalid> - 2012-02-02 20:14 -0500
            Re: Setting JList size Jeff Higgins <jeff@invalid.invalid> - 2012-02-03 05:26 -0500

csiph-web