problemas con JLabel(no se muestra en frame)
Publicado por julio (5 intervenciones) el 18/08/2019 21:12:55
buenas estoy practicando con la libreria swing con Jlabel, pero no me aparece la label ya use el metodo setVisible y no quiere mostrarse voy a dejar el codigo si alguien sabe porque no quiere
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
package grafico1;
import java.util.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JButton;
public class Grafico1 extends JFrame{
public Grafico1(){
setBounds(+600,+200,500,350);
setTitle("mr operaciones");
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
initComponents();
}
private void initComponents(){
JButton aceptar;
JPanel panel = new JPanel();
setLayout(null);
this.getContentPane().add(panel);
initJlabel();
}
public void initJlabel(){
JLabel saludo;
saludo = new JLabel("nombre");
saludo.setLocation(+600,+200);
initareatext();
}
private static void initareatext(){
initButtons();
}
private static void initButtons(){
}
public static void main(String[] args) {
Grafico1 v = new Grafico1();
}
}
Valora esta pregunta


0