Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. import javax.swing.*;
  2.  
  3.  
  4. public class Test extends JFrame    {
  5.    
  6.     JPanel p = new JPanel();
  7.     JButton b = new JButton("Hello");
  8.     JTextField t = new JTextField("Hi");
  9.     JTextArea ta = new JTextArea("How are you");
  10.     JCheckBox cb = new JCheckBox("Hello");
  11.     //JFileChooser fc = new JFileChooser();
  12.     JScrollBar sb = new JScrollBar();
  13.    
  14.     public static void main(String[] args) {
  15.        
  16.         new Test();
  17.        
  18.        
  19.     }
  20.     public Test()   {
  21.         super("Basic Swing App");
  22.         setSize(400, 300);
  23.         setResizable(true);
  24.         p.add(b);
  25.         p.add(t);
  26.         p.add(ta);
  27.         p.add(cb);
  28.         p.add(sb);
  29.         add(p);
  30.         setDefaultCloseOperation(EXIT_ON_CLOSE);
  31.         setVisible(true);
  32.     }
  33.    
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement