Oslapas

Untitled

Nov 13th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 KB | None | 0 0
  1.  
  2.     private class DrawPanel extends JPanel {
  3.  
  4.         protected void paintComponent(Graphics g) {
  5.             super.paintComponent(g);
  6.             g.setColor(Color.GREEN);
  7.             g.fillRect(x, y, 50, 50);
  8.         }
  9.  
  10.         public Dimension getPreferredSize() {
  11.             return new Dimension(D_W, D_H);
  12.         }
  13.     }
Add Comment
Please, Sign In to add comment