@Override protected void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; if (image == null) { painter.paintPanel(this, g2); } else { painter.paintImage(this, image, g2); } }
@Override protected void paintComponent(Graphics g) { super.paintComponent(g); if (image == null) { painter.paintPanel(this, (Graphics2D) g); } else { painter.paintImage(this, image, (Graphics2D) g); } }