Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public janela(){
- window = new JFrame("teste");
- window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- window.setSize(300,300);
- contentor = window.getContentPane();
- contentor.setLayout(new BorderLayout());
- pick = new JButton("PICK");
- contentor.add(pick, BorderLayout.NORTH);
- interior = new JPanel();
- interior.setLayout(new GridLayout(5,5));
- contentor.add(interior, BorderLayout.CENTER);
- for(int i = 0; i < 25; i++){
- square x = new square(new Random().nextInt(256),new Random().nextInt(256),new Random().nextInt(256));
- interior.add(x);
- }
- interior.repaint();
- System.out.println(interior.getSize().getHeight()); //Stills says zero..
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement