Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Window extends JFrame{
- private static final long serialVersionUID = 1L;
- private static final String NAME = "Macedonia";
- private static final Color BG_COLOR = Color.DARK_GRAY;
- private Figura f[];
- public Window(){
- JFrame frame = new JFrame(NAME);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setBackground(BG_COLOR);
- frame.setSize(100, 100);
- f = new Figura[30];
- for(int i=0; i<f.length; i++){
- }
- f[0] = new Figura(600, 500, BG_COLOR);
- f[0].setSizeOfRect(40, 40);
- f[0].setPosition(10, 10);
- f[0].setColor(Color.RED);
- f[1] = new Figura(600, 500, BG_COLOR);
- f[1].setSizeOfRect(40, 40);
- f[1].setPosition(60, 10);
- f[1].setColor(Color.BLUE);
- frame.add(f[0]);
- frame.add(f[1]);
- frame.pack();
- frame.setVisible(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement