hi, i have a problem combining JScrollPane + JPanel and adding a 'zoom' function. Right now i have a class that extends a JPanel with a paint() method and two methods which called can perform a zoom function - really just doubles the size of the JPanel and called to repaint with the new location of things.
All the above is also in a JScrollpane so if the JPanel gets to big, its scrollable - This bit works fine.
The problem when i want to zoom in/out i want it to zoom in at the point of where it was before clicking to zoom. Right now everytime i do a zoom, the viewable area focusese on the top left of the JPanel (i think maybe because it retains the last coords of the viewed area?) instead of zooming in on the area viewed before zoom.
All the above is also in a JScrollpane so if the JPanel gets to big, its scrollable - This bit works fine.
The problem when i want to zoom in/out i want it to zoom in at the point of where it was before clicking to zoom. Right now everytime i do a zoom, the viewable area focusese on the top left of the JPanel (i think maybe because it retains the last coords of the viewed area?) instead of zooming in on the area viewed before zoom.