Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JScrollPane: how to set position of scroller ?

65 views
Skip to first unread message

Christophe MOINE

unread,
Feb 4, 2001, 4:59:11 PM2/4/01
to
I have a lot encounter problems to set the position of a scroller for a
JScrollPane:

I try use scrollRectToVisible() method, and getViewPort.setViewLocation ()
method, but it really seem to me that they containts bugs.
When I try those methods with simple values, it does not work ?!?

The scroller don't move; even with revalidate() and repaint() procedure.

In conclusion, is there a easy solution to move the scrollBar (JScrollBar ?)
when I want to zoom in a area of my JPanel ?

excuse my poor English......


Ben Gitnick

unread,
Feb 8, 2001, 10:36:57 PM2/8/01
to
JScrollPane pane = new JScrollPane();
pane.getVerticalScrollBar().setValue(b);

Ben Gitnick

Christophe MOINE <christop...@free.fr> wrote in message
news:95mlug$31au$1...@news4.isdnet.net...

Christophe MOINE

unread,
Feb 9, 2001, 5:07:12 AM2/9/01
to
Super ! Thanks a lot !

Ben Gitnick <git...@ex-pressnet.com> a écrit dans le message :
t86pfd...@corp.supernews.com...

Christophe MOINE

unread,
Feb 9, 2001, 5:58:09 AM2/9/01
to
In fact, it does no mean things !

Isn't ther a bug .... in jdk1.3 of JBuilder ?

Or isn't there a method which update the ScrollBar ?

Ben Gitnick <git...@ex-pressnet.com> a écrit dans le message :
t86pfd...@corp.supernews.com...

Maxime Jeanmart

unread,
Feb 19, 2001, 3:32:13 AM2/19/01
to
I've used
jScrollPane1.getVerticalScrollBar().setValue(loc);
to move the bar
Don't forget to take bar.getMaximum() and bar.getModel().getExtend() into
account when calculating loc (if you need to).

I also have problems when the scroll bar's maximum is low.

Maxime Jeanmart

vcard.vcf
0 new messages