Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.BorderLayout;
- public class MainWindow extends JFrame {
- private JPanel contentPane;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- MainWindow frame = new MainWindow();
- frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the frame.
- */
- public MainWindow() {
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setBounds(100, 100, 450, 300);
- contentPane = new JPanel();
- contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
- setContentPane(contentPane);
- contentPane.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
- JPanel panel = new JPanel();
- contentPane.add(panel);
- JButton btnNewButton_1 = new JButton("New button");
- panel.add(btnNewButton_1);
- JButton btnNewButton_2 = new JButton("New button");
- panel.add(btnNewButton_2);
- JButton btnNewButton = new JButton("New button");
- panel.add(btnNewButton);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement