Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.*;
- package seventhlecture;
- public class Gui {
- private JFrame f;
- private JPanel p;
- private JLabel lab;
- private JButton b1;
- public test (){
- gui ();
- }
- public void gui(){
- f = new JFrame("My frame");
- f.setVisible(true);
- f.setSize(720, 580);
- f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- p= new JPanel();
- p.setBackground(Color.BLUE);
- b1= new JButton("Click");
- lab = new JLabel ("My label");
- p.add(b1);
- p.add(lab);
- f.add(p);
- }
- public static void main(String[] args) {
- new Gui();
- }
- }
- import javax.swing.*;
- import java.awt.*;
- package seventhlecture;
- public class Gui {
- private JFrame f;
- private JPanel p;
- private JLabel lab;
- private JButton b1;
- public test (){
- gui ();
- }
- public void gui(){
- f = new JFrame("My frame");
- f.setVisible(true);
- f.setSize(720, 580);
- f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- p= new JPanel();
- p.setBackground(Color.BLUE);
- b1= new JButton("Click");
- lab = new JLabel ("My label");
- p.add(b1);
- p.add(lab);
- f.add(p);
- }
- public static void main(String[] args) {
- new Gui();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement