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 / December 2003

Tip: Looking for answers? Try searching our database.

How do you do 2 columns, one scrollable?

Thread view: 
VisionSet - 28 Dec 2003 22:31 GMT
I would like to display 2 columns of many rows.
the left column will be fixed in the horizontal and should display all its
contents, each cell will be a single JLabel
the right column will be scrollable (ie all right-hand cells together) each
cell will be a single JComponent with graphics

ie:

--------------------
|     |            |
--------------------
|     |            |
--------------------
|     |            |
--------------------
|     |            |
--------------------
|     |            |
--------------------
      <-scrollbar->

One solution is to have 2 components 1 for each column and gridlayout them.
the right-hand one can be nested in a jscrollpane.

But the neccessary scrollbar would interfere with the bottom cell, so it'd
be best to put it below.

I see that I can get the scrollbar from the scrollpane.  So that shouldn't
be  a problem.

But is there a better way?
I haven't used JTables, can these do this?  Had a quick look but don't see
any mention of scrollbar policy.

Thanks.
Signature

Mike W

David Postill - 28 Dec 2003 23:42 GMT
In article <%LIHb.12225$FN.7739@newsfep4-winn.server.ntli.net>, on Sun, 28 Dec 2003 22:31:06 -0000,
"VisionSet"
<spam@ntlworld.com> wrote:

| I would like to display 2 columns of many rows.
| the left column will be fixed in the horizontal and should display all its
| contents, each cell will be a single JLabel
| the right column will be scrollable (ie all right-hand cells together) each
| cell will be a single JComponent with graphics

<snip />

| I haven't used JTables, can these do this?  Had a quick look but don't see
| any mention of scrollbar policy.

Yes they can. See:

  * Article: [[http://www.codeguru.com/java/articles/128.shtml][Fixed Columns]] Row header

<davidp />

- --
David Postill
VisionSet - 29 Dec 2003 10:28 GMT
> | I haven't used JTables, can these do this?  Had a quick look but don't see
> | any mention of scrollbar policy.
[quoted text clipped - 4 lines]
>
> <davidp />

Thanks, I see you need 2 tables to achieve the effect, but no matter.

Signature

Mike W



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



©2009 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.