Get the Middle of JScrollPane

How do you get the middle of the area being shown in a JScrollPane?Thanks!
[88 byte] By [JustAnotherProgramer] at [2007-9-27 20:07:51]
# 1
You must calculate the x and y of center point, and use below program.JViewport jv = jScrollPane.getViewport();jv.setViewPosition(new Point(centerX, centerY));
prins-Wu at 2007-7-7 0:08:38 > top of Java-index,Archived Forums,Swing...
# 2
Thanks
JustAnotherProgramer at 2007-7-7 0:08:38 > top of Java-index,Archived Forums,Swing...
# 3
What I'm trying to do is, when you scroll the picture in the middle will always be there.
JustAnotherProgramer at 2007-7-7 0:08:38 > top of Java-index,Archived Forums,Swing...
# 4
Not the entire area; Just the part of the jscrollpane being shown.
JustAnotherProgramer at 2007-7-7 0:08:38 > top of Java-index,Archived Forums,Swing...