Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. public class Window extends JFrame{
  2.  
  3. private static final long serialVersionUID = 1L;
  4. private static final String NAME = "Macedonia";
  5. private static final Color BG_COLOR = Color.DARK_GRAY;
  6. private Figura f[];
  7.  
  8. public Window(){
  9. JFrame frame = new JFrame(NAME);
  10. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  11. frame.setBackground(BG_COLOR);
  12. frame.setSize(100, 100);
  13. f = new Figura[30];
  14. for(int i=0; i<f.length; i++){
  15.  
  16. }
  17. f[0] = new Figura(600, 500, BG_COLOR);
  18. f[0].setSizeOfRect(40, 40);
  19. f[0].setPosition(10, 10);
  20. f[0].setColor(Color.RED);
  21.  
  22. f[1] = new Figura(600, 500, BG_COLOR);
  23. f[1].setSizeOfRect(40, 40);
  24. f[1].setPosition(60, 10);
  25. f[1].setColor(Color.BLUE);
  26.  
  27. frame.add(f[0]);
  28. frame.add(f[1]);
  29.  
  30. frame.pack();
  31. frame.setVisible(true);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement