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

Tip: Looking for answers? Try searching our database.

JScrollPane & the scroll speed ?

Thread view: 
Dado - 30 Aug 2006 10:32 GMT
Is it difficult to speed up the scroll of JScrollPane content ? It is too
slow for me, if I use the mouse wheel or arrows of a slider.
Bart Cremers - 30 Aug 2006 11:14 GMT
> Is it difficult to speed up the scroll of JScrollPane content ? It is too
> slow for me, if I use the mouse wheel or arrows of a slider.

You'll have to override the scrollable increment methods in your
scrollable component (the thing you add to the scrollpane). Following
code makes scrolling in a JEditorPane really slow. The numeric values
are the number of pixels the view should be moved for a click on the
arrow or in the gray area of the scrollbar.

JEditorPane ePane = new JEditorPane(url) {
   public int getScrollableUnitIncrement(Rectangle visibleRect, int
orientation, int direction) {
       return 1;
   }

   public int getScrollableBlockIncrement(Rectangle visibleRect, int
orientation, int direction) {
       return 2;
   }
};

Regards,

Bart
Brandon McCombs - 30 Aug 2006 23:44 GMT
>> Is it difficult to speed up the scroll of JScrollPane content ? It is too
>> slow for me, if I use the mouse wheel or arrows of a slider.
[quoted text clipped - 20 lines]
>
> Bart

Why override when he can simply do the following to the scrollpane itself?

myScrollPane.getHorizontalScrollBar().setUnitIncrement(10);
myScrollPane.getVerticalScrollBar().setUnitIncrement(10);

Those work fine for me when having a jlist in a scrollpane.
Bart Cremers - 31 Aug 2006 08:01 GMT
> >> Is it difficult to speed up the scroll of JScrollPane content ? It is too
> >> slow for me, if I use the mouse wheel or arrows of a slider.
[quoted text clipped - 27 lines]
>
> Those work fine for me when having a jlist in a scrollpane.

Damn, I was looking for such method in JScrollPane and in JViewport,
never occured to me to look on the scrollbars to set them.

Thanks,

Bart
Thomas A. Russ - 01 Sep 2006 19:41 GMT
JScrollBar.setUnitIncrement

Signature

Thomas A. Russ,  USC/Information Sciences Institute



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.