I have a map displayed in a JScrollPane and zoom it by adjusting the setPreferredSize method of the map, then calling JScrollPane.revalidate. However, the center of the viewport does not point to the same position on the map anymore. How can I adjust that?
I know the viewport.getViewPosition() method, but don't grasp the necessary mathematics to do the trick :confused: