-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLabelExample.java
52 lines (39 loc) · 1.11 KB
/
LabelExample.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
/*
import javax.swing.*;
public class LabelExample {
public static void main(String args[]) {
// Criando o objeto da classe JFrame e da classe JLabel
JFrame f = new JFrame("Exemplo de rótulo");
JLabel l1, l2;
// Inicializando os rótulos
l1 = new JLabel("Primeiro Rótulo");
l2 = new JLabel("Segundo Rótulo");
// Definir o local do rótulo
l1.setBounds(50, 50, 100, 30);
l2.setBounds(50, 100, 100, 30);
// Adicionando rótulos ao quadro
f.add(l1);
f.add(l2);
// Definindo tamanho, layout e visibilidade do quadro
f.setSize(300, 300);
f.setLayout(null);
f.setVisible(true);
}
}
*/
/*import java.awt.*;
import java.awt.event.*;
public class LabelExample extends Frame implements ActionListerner{
TextField tf;
Rótulo l;
Button b;
LabelExample(){
tf = new TextField();
tf = new TextField();
tf.setBounds(50, 50, 150, 20);
l = new Rótulo();
l.setBounds(50, 100, 250, 20);
}
}
*/
//https://www.javatpoint.com/java-awt-label