Resize Graphics2d into JScrollPane
问题 In connection with question Resizing a component without repainting is my question how to create resiziable custom Graphics2d in form import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ZoomWithSelectionInViewport implements MouseWheelListener { private JComponent b; private int hexSize = 3; private int zoom = 80; private JScrollPane view; public ZoomWithSelectionInViewport() throws Exception { b = new JComponent() { private static final long serialVersionUID = 1L;