Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   Is there a Floating Scrollbar component for Tables (http://www.programmingforums.org/showthread.php?t=10747)

hemanth.balaji Jul 17th, 2006 8:23 AM

Is there a Floating Scrollbar component for Tables
 
I have a table which is placed in a Panel. This panel contains a Horizonal Scroll Bar which when scrolled to the right enables us to see the whole JTable. Now the Table itself has a vertical scrollbar.

The probelm is when the user can't see the whole table he does not know that that the table contains a vertical scroll bar.

Is there a way to make the vertical scrollbar of the table floating so that even when you scroll to the right the vertical scrollbar of the table is scrolling as you scroll to the right by clicking on the panel scrollbar

Regards,
Hemanth
http://www.freejavaguide.com

ReggaetonKing Jul 17th, 2006 11:18 AM

Can you put up your code so I can understand what you need to do. I don't understand the problem.

DaWei Jul 17th, 2006 11:47 AM

What he's saying is that the horizontal scrollbar deals with the entire window (or panel), while the vertical scrollbar is part of the table. If you scroll the part of the table which contains the scrollbar off-screen, the user can't see that the table even has a vertical scrollbar. I'm not familiar with the Java that the OP is using, but I have a similar situation on an HTML page. I just control it so that there's no horizontal scroll bar -- the whole dam' shooting match fits on the screen, horizontally. If the user selects a lebenty-leben point font, then it just wraps between each letter. I realize that one can't always avoid horizontal scrollbars, but it's a situation to be strived for, presentationally speaking.

ReggaetonKing Jul 17th, 2006 12:02 PM

Thanks for the clearing that up for me.

@O.P.: try using the JScrollPane class. It would put the panel into a container that automatically comes with a veritical and horizontal scrollbar. It will be on the outside of the container. Try that. Post back.

titaniumdecoy Jul 17th, 2006 12:21 PM

Resizing the table to be the same size as, or smaller than, the window that contains it would likely negate the need for the window to have its own scroll bars. I suggest using a BorderLayout and placing the table in the BorderLayout.CENTER so that it will expand to the edges of the window.

hemanth.balaji Jul 17th, 2006 12:54 PM

Guys, Thanx for the replies

ReggaetonKing Jul 17th, 2006 2:49 PM

Can you post your code?


All times are GMT -5. The time now is 12:20 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC