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

Tip: Looking for answers? Try searching our database.

Get track size/location from JScrollBar

Thread view: 
Robert - 23 May 2006 09:01 GMT
Hi,

I am in need of retrieving the track size of a vertical
JScrollBar, in particular its height.

Also, I would need to get hold on where the track
starts within the scrollbar, I guess this could be calculated by
getting the upper arrow button and query it for its height.

Now, I've checked the API but no luck, is this possible?

Kind Regards,
Robert
Thomas Weidenfeller - 23 May 2006 09:33 GMT
> I am in need of retrieving the track size of a vertical
> JScrollBar,
[...]
> Now, I've checked the API but no luck, is this possible?

My guess, I didn't look it up, would be that this stuff is hard-coded
somewhere in each PLAF. And that there is no API, probably not even an
undocumented, to obtain this information.

Why do you think you need to know this?

/Thomas

Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

Robert - 23 May 2006 09:44 GMT
I am building a "relative gutter", need to mark certain
places in the document, and these should map to the JScrollbar's track,
so one can easily find the right location in the document.

Perhaps, there is another solution the my problem.

// Robert
Thomas Weidenfeller - 23 May 2006 10:28 GMT
> I am building a "relative gutter", need to mark certain
> places in the document, and these should map to the JScrollbar's track,
> so one can easily find the right location in the document.

https://flamingo.dev.java.net/docs/file-viewer.html 's
RelativeGutterPanel is maybe what you want. There the markers are not
aligned with the scroll bar, but with the text panel as such. And the
markers are clickable, so one doesn't have to rely on a 1:1 match with
the scroll bar position.

/Thomas
Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

Robert - 23 May 2006 10:56 GMT
Thanks for the pointer I'll give it a try.

// Robert


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.