-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClase Java 22.java
More file actions
51 lines (27 loc) · 1.53 KB
/
Clase Java 22.java
File metadata and controls
51 lines (27 loc) · 1.53 KB
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
//--------------------------------------------------------------|
//CONTENIDO: Java Swing
//--------------------------------------------------------------|
package ClaseJava;
//-----------------------------------------|
import javax.swing.JFrame;
//-----------------------------------------|
//-----------------------------------------|
import javax.swing.JPanel;
//-----------------------------------------|
public class ClaseJava22 extends JFrame {
public ClaseJava22(){
JFrame jf = new JFrame ("Clase Java 22"); //Creamos el marco
JPanel jp = new JPanel(); //Creamos el lienzo (panel)
jf.setContentPane(jp); //Ponemos el lienzo en el marco
jf.setSize(300,200); //Establecemos el tamaño del marco
jf.setLocationRelativeTo(null); //Centramos la ventana en la pantalla
jf.setVisible(true); //Hacemos visible la ventana
//setVisible(false)-> Oculta el componente, pero sigue existiendo en memoria.
}
//----------------------------------------------------------------------------------------------------------------|
//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//----------------------------------------------------------------------------------------------------------------|
public static void main(String[] args) {
ClaseJava22 aplicacion = new ClaseJava22(); //Mostrar ventana
}
}