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 / July 2006

Tip: Looking for answers? Try searching our database.

custom scroll bar

Thread view: 
akhila - 20 Jul 2006 14:59 GMT
Hi,

 I want to implement a custom scroll bar which functions like the one
in StartMenu->Programs option. Instead of a vertical scroll bar I want
buttons at the top and botton of the frame and on mouse over of it I
want to implement the vertical scroll bar functionality. Is there any
way to do it in Java. Basically I have  a panel where in I have added a
JTree component. I want to implement these scroll bars in this panel.

Thanks in advance.
Ralf Seitner - 20 Jul 2006 15:38 GMT
akhila schrieb:
> Hi,
>
[quoted text clipped - 6 lines]
>
> Thanks in advance.

Hi!
I think you are not looking for a scrollbar (JScrollBar), but looking
for a JPopupMenu (javax.swing.JPopupMenu).
Have a look at the swing tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html

bye, Ralf
Andrey Kuznetsov - 20 Jul 2006 16:22 GMT
>  I want to implement a custom scroll bar which functions like the one
> in StartMenu->Programs option. Instead of a vertical scroll bar I want
> buttons at the top and botton of the frame and on mouse over of it I
> want to implement the vertical scroll bar functionality. Is there any
> way to do it in Java. Basically I have  a panel where in I have added a
> JTree component. I want to implement these scroll bars in this panel.

I think that I understand what you mean,
however this is horrible thing - I hate it - aspecially if there are
*very*many*items*to*scroll*,
you may scroll half a year to last item.

I think you can hack it very easy - take JScrollPane and make both scroll
bars always invisible.
Now you just need two JButtons and implement mouse handling - by mouse over
buttons
you decrement/increment position of JScrollPane's verticall JScrollBar.

Thats it!

Andrey

--
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities


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.