Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.BorderLayout;
- import java.awt.Dimension;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.BoxLayout;
- import javax.swing.JButton;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- public final class GUI extends JFrame
- {
- private JButton submit;
- private JPanel btnList;
- public GUI()
- {
- setLayout(new BorderLayout());
- JPanel content = new JPanel();
- content.setLayout(new BorderLayout());
- content.setPreferredSize(new Dimension(200, 300));
- this.getContentPane().add(content);
- btnList = new JPanel();
- btnList.setLayout(new BoxLayout(btnList, BoxLayout.PAGE_AXIS));
- submit = new JButton("Get Random");
- //Add Components to this container
- content.add(submit, BorderLayout.NORTH);
- content.add(btnList, BorderLayout.CENTER);
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- pack();
- }
- private void makeButtons(int number)
- {
- validate();
- }
- public static void main(String[] args)
- {
- //Schedule a job for the event-dispatching thread:
- //creating and showing this application's GUI.
- javax.swing.SwingUtilities.invokeLater(new Runnable()
- {
- public void run()
- {
- //Create and set up the content pane.
- GUI frame = new GUI();
- frame.setVisible(true);
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement