-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.java
53 lines (43 loc) · 1.31 KB
/
check.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
/**
*
* @author user
*/
public class check extends JFrame {
JLabel l1, l2, l3;
check() {
JFrame f = new JFrame("Panel Example");
JPanel panel = new JPanel();
TitledBorder title;
title = BorderFactory.createTitledBorder("title");
title.setTitleJustification(TitledBorder.LEFT);
panel.setBorder(title);
panel.setBounds(40, 80, 200, 200);
panel.setBackground(Color.gray);
JButton b1 = new JButton("Button 1");
b1.setBounds(50, 100, 80, 30);
b1.setBackground(Color.yellow);
JButton b2 = new JButton("Button 2");
b2.setBounds(100, 100, 80, 30);
b2.setBackground(Color.green);
panel.add(b1);
panel.add(b2);
f.add(panel);
f.setSize(400, 400);
f.setLayout(null);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
class forgt {
public static void main(String[] args) {
check s = new check();
}
}