Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Kyle McMenomy
- import java.awt.*;
- import javax.swing.*;
- public class GUIBasics {
- public static void main(String[] args) {
- JFrame frame = new JFrame();
- frame.setTitle("Chapter 12");
- frame.setSize(500, 400);
- frame.setLocationRelativeTo(null);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setVisible(true);
- frame.setLayout(new GridLayout());
- JLabel jlblLabel = new JLabel();
- jlblLabel.setText("Welcome");
- frame.add(jlblLabel);
- JButton jbButton = new JButton("Button Here");
- frame.add(jbButton);
- frame.add(new JButton("Help"));
- }
- }
Add Comment
Please, Sign In to add comment