Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- super("Simple Submit Cancel Form"); //Create JFrame with title.
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- this.setResizable(false);
- this.setSize(300,100); //300*100 pixels.
- Container pane = this.getContentPane();
- pane.setLayout(new GridLayout(2,1)); //Give the pane two rows and one collumn.
- JPanel textPane = new JPanel(); //Create a smaller pane to hold the buttons.
- JTextField textField = new JTextField("",23);
- textPane.add(textField); //Add the textfield to the textPane.
- pane.add(textPane);
- JPanel buttonPane = new JPanel(); //Create a smaller pane to hold the buttons.
- JButton submitButton = new JButton("Submit");
- JButton cancelButton = new JButton("Cancel");
- buttonPane.add(submitButton); //Add buttons to the buttonPane.
- buttonPane.add(cancelButton);
- pane.add(buttonPane); //Add buttonPane to the pane.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement