Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.FlowLayout;
- import javax.swing.*;
- public class Main {
- public static void main(String[] args) {
- JFrame frame = new JFrame("GUI");
- JLabel label = new JLabel("hello world");
- JButton button = new JButton("push");
- frame.getContentPane().setLayout(new FlowLayout());
- frame.getContentPane().add(label);
- frame.getContentPane().add(button);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setSize(300,100);
- frame.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement