Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- public class Test extends JFrame {
- JPanel p = new JPanel();
- JButton b = new JButton("Hello");
- JTextField t = new JTextField("Hi");
- JTextArea ta = new JTextArea("How are you");
- JCheckBox cb = new JCheckBox("Hello");
- //JFileChooser fc = new JFileChooser();
- JScrollBar sb = new JScrollBar();
- public static void main(String[] args) {
- new Test();
- }
- public Test() {
- super("Basic Swing App");
- setSize(400, 300);
- setResizable(true);
- p.add(b);
- p.add(t);
- p.add(ta);
- p.add(cb);
- p.add(sb);
- add(p);
- setDefaultCloseOperation(EXIT_ON_CLOSE);
- setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement