Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2006

Tip: Looking for answers? Try searching our database.

JTable too Wide

Thread view: 
Roedy Green - 28 Dec 2005 20:30 GMT
Let's say you were designed a JTable and it came out too wide.  You
would prefer not to scroll.  What are your options?

1. some way of doing data entry in a narrow multiline cell?

2. alternating what is in odd-even rows?

3. variable width columns, something to widen temporarily a given cell
with just a keystroke?

4. something else?
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Oliver Wong - 11 Jan 2006 17:07 GMT
> Let's say you were designed a JTable and it came out too wide.  You
> would prefer not to scroll.  What are your options?
[quoted text clipped - 7 lines]
>
> 4. something else?

   There are two main reasons why your table might be too wide.

   (1) The values are really long (e.g. arbitrarily long text strings)
   (2) The number of columns is very high.

   For (1), you can usually just visually truncate the text after a certain
maximum length, perhaps appending "..." at the end to give the user a visual
clue that some data is missing. Of course, as soon as the user wishes to
edit the data, you display the full text in some scrollable text box.

   For (2) the generic trick is to get rid of some columns. Usually the
columns can be sorted into two categories "identifiers" and "details".
"identifiers" are the columns that are likely to be indices in a relation
DB, that the user will probably want to sort upon, and scan through to find
a specific item. A table of people, for example might have their last names,
user id, social security number or internal id number as their identifiers.
You want to keep the identifier columns.

   The detail columns are the information the user wishes to read, ONLY for
the rows she is interested in. That is usually the user doesn't want to see
the details of ALL the rows. Contrast this with the identifiers, where the
user usually DOES want to see the identifiers of all the rows, to quickly
identify the row she is interested in.

   In Java, you can use a splitframe so that the table with the identifier
columns are displayed on one side, and the detail information (not
nescessarily in the form of a JTable) of the current selected row is
displayed on the other side of the splitframe.

   - Oliver


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.