Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.samkough.main;
- import javax.swing.*;
- import java.awt.*;
- @SuppressWarnings("serial")
- public class Sam extends JFrame
- {
- public static int WIDTH = 600;
- public static int HEIGHT = 600;
- private JLabel l1;
- private JButton b1;
- private JTextField tf1;
- private JRadioButton rb1;
- private JCheckBox cb1;
- private JMenuItem mi1;
- public static void main(String args[])
- {
- Sam frame = new Sam();
- frame.setVisible(true);
- frame.setTitle("Sam");
- frame.setSize(WIDTH, HEIGHT);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setLocationRelativeTo(null);
- }
- public Sam()
- {
- setLayout(new FlowLayout());
- l1 = new JLabel("This is label");
- b1 = new JButton("This is button");
- tf1 = new JTextField("This is text field");
- rb1 = new JRadioButton("This is radio button");
- cb1 = new JCheckBox("This is check box");
- mi1 = new JMenuItem("This is menu item");
- add(l1);
- add(b1);
- add(tf1);
- add(rb1);
- add(cb1);
- add(mi1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment