Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- panel=new JPanel();
- add(panel);
- panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
- JButton button1=new JButton("button1");
- JButton button2=new JButton("button2");
- buttonsPanel=new JPanel();
- buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.X_AXIS));
- buttonsPanel.add(button1, CENTER_ALIGNMENT);
- buttonsPanel.add(button2, CENTER_ALIGNMENT);
- panel.add(buttonsPanel, BorderLayout.CENTER);
- buttonsPanel.add(button1, CENTER_ALIGNMENT);
- panel.add(buttonsPanel, BorderLayout.CENTER);
- JPanel buttonsPanel = new JPanel();
- buttonsPanel.add(button1);
- buttonsPanel.add(button2);
- frame.setLayout( new GridBagLayout() );
- frame.add(buttonsPanel, new GridBagConstraints());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement