Programmtically Scrolling a Scrollpane
From: Aaron Davies (aaron.davies_at_knox.army.mil.invalid)
Date: 07/27/04
- Next message: Scott Ellsworth: "Re: What does "refactoring" of a project mean ?"
- Previous message: Craig Kelley: "Re: filtering wave audio file"
- Next in thread: ak: "Re: Programmtically Scrolling a Scrollpane"
- Reply: ak: "Re: Programmtically Scrolling a Scrollpane"
- Reply: Thomas Weidenfeller: "Re: Programmtically Scrolling a Scrollpane"
- Reply: Christian Kaufhold: "Re: Programmtically Scrolling a Scrollpane"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 27 Jul 2004 20:33:15 GMT
Hi, I'm writing a graphics program, and I'm currently implementing a
zoom function. The graphics are drawn on a JPanel wrapped in a
JScrollPane, and while my zoom is working fine as far as scaling the
graphics, I'm having a lot of trouble figuring out how to scroll the
scrollpane. After zooming, I would like to scroll the pane so that the
point clicked is in the center, so as to follow the "zoom in"
conventions in other graphics progs. (At the moment, the pane is always
scrolled top-left after a zoom.) I've tried invoking scrollRectToVisible
to on the pane's viewport, but it doesn't seem to work. I've also tried
using the setValue methods on the pane's scrollbars, but that doesn't do
anything either. Does anyone have any ideas?
- Next message: Scott Ellsworth: "Re: What does "refactoring" of a project mean ?"
- Previous message: Craig Kelley: "Re: filtering wave audio file"
- Next in thread: ak: "Re: Programmtically Scrolling a Scrollpane"
- Reply: ak: "Re: Programmtically Scrolling a Scrollpane"
- Reply: Thomas Weidenfeller: "Re: Programmtically Scrolling a Scrollpane"
- Reply: Christian Kaufhold: "Re: Programmtically Scrolling a Scrollpane"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|