Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #4981
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Jeff Higgins <jeff@invalid.invalid> |
| Newsgroups | comp.lang.java.gui |
| Subject | Re: Setting JList size |
| Date | Thu, 02 Feb 2012 16:09:48 -0500 |
| Organization | A noiseless patient Spider |
| Lines | 23 |
| Message-ID | <jgeu30$9ua$1@dont-email.me> (permalink) |
| References | <3365e0a4-b13f-4c2c-a2d8-8c31a9663593@x6g2000pbk.googlegroups.com> <jgeg8q$e9e$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Thu, 2 Feb 2012 21:09:53 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="BSKXKq4dV+7jFlM4JDctyw"; logging-data="10186"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ThU8vJQJthGu+CBqQBQgcpaJFAFXrHfo=" |
| User-Agent | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20111110 Icedove/3.0.11 |
| In-Reply-To | <jgeg8q$e9e$1@dont-email.me> |
| Cancel-Lock | sha1:Ee523KudMhTlsx1wnpjyJmoo7jE= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.gui:4981 |
Show key headers only | View raw
On 02/02/2012 12:13 PM, Jeff Higgins wrote: > On 02/02/2012 11: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? > > What have you tried? > When you setVisibleRowCount() on your JList what happens when you > subsequently change the font? Using the ListDemo.java from the Java Tutorial: If I add the following line to the ListDemo.FireListener.actionPerformed() method the setVisibleRowCount(5) is not honored. So I guess if you are changing the font dynamically you will have some extra work to perform. list.setFont(list.getFont().deriveFont(16.0f));
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar
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