protected void paintComponent(Graphics g2) { super.paintComponent(g2); Graphics2D g = (Graphics2D) g2; test.draw(g2, 0, 0); // Shape triangle = new Polygon(new int[] {15, 20, 10}, new int[] {0, 10, 10}, 3); Shape square = new Rectangle2D.Double(0, 0, 30, 30); g.setColor(Color.white); g.translate(20, 20); // g.rotate(theta, 10, 10); // g.fill(star); // g.setColor(new Color(0, 86, 141)); // g.fill(square); if (star2 != null) g.fill(star2); // Graphics2D g3 = (Graphics2D) g; // 3.fill(star); // g.setStroke(new BasicStroke(1)); // g.translate(x, y); // g.draw(line); // g.draw(line2); }