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


Groups > comp.lang.java.programmer > #24142

Re: Best Algorithm for Preferred Size of Dynamically Growing jTable

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Best Algorithm for Preferred Size of Dynamically Growing jTable
Date 2013-05-20 15:39 -0400
Organization A noiseless patient Spider
Message-ID <kndtuh$b8r$1@dont-email.me> (permalink)
References <798751b2-6465-4359-b8be-f581a3f41ac6@j4g2000yqc.googlegroups.com>

Show all headers | View raw


On 5/20/2013 3:23 PM, Haircuts Are Important wrote:
> I once had to build a large jTable and I noticed that after the table
> became large things weren't shown in the table.
>
> I forgot how I fixed it.
>
> Question: Is there some preferred way to adjust the size of a
> dynamically growing jTable.

     A common practice is to put the JTable in a JScrollPane and
let the user decide how much screen real estate it should have.
In addition, you might try setPreferredScrollableViewportSize(),
although I don't know off-hand whether this does anything for a
JTable that's already displayed (if it doesn't, I imagine a call
to revalidate() might help).

> I'm using new Courier Font because I want the characters to be the
> same width.

     Although this may affect the actual sizes, I doubt it makes
a difference in how readjustment happens.

-- 
Eric Sosman
esosman@comcast-dot-net.invalid

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Best Algorithm for Preferred Size of Dynamically Growing jTable Haircuts Are Important <clusardi2k@aol.com> - 2013-05-20 12:23 -0700
  Re: Best Algorithm for Preferred Size of Dynamically Growing jTable Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-05-20 15:39 -0400

csiph-web