I am working on creating a zoom on a JPanel inside of a JFrame.
At the current moment, the JPanel which houses an image is in paintComponent with Graphics2D. I plan on using the bufferedimage to scale it according to button presses. Right now, I add the JScrollPane when I first call my constructor:
private void createMainPanel()
main = new MainPanel();
scrollPane = new JScrollPane();
the problem is, once I resize (call repaint), the JScrollPane stays the same size as before, because the createMainPanel() is never called again. Is there a way to have the JScrollpane change with the MainPanel class which houses the Graphics2D?
Thanks a lot,