Advertisement
Guest User

Untitled

a guest
May 31st, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import java.awt.FlowLayout;
  2. import javax.swing.*;
  3. public class Main {
  4. public static void main(String[] args) {
  5. JFrame frame = new JFrame("GUI");
  6. JLabel label = new JLabel("hello world");
  7. JButton button = new JButton("push");
  8. frame.getContentPane().setLayout(new FlowLayout());
  9. frame.getContentPane().add(label);
  10. frame.getContentPane().add(button);
  11. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  12. frame.setSize(300,100);
  13. frame.setVisible(true);
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement