Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/01/2011, 07:50
sirdaiz
 
Fecha de Ingreso: diciembre-2010
Mensajes: 459
Antigüedad: 13 años, 4 meses
Puntos: 21
Problema con swing

public class Main {

public static void main(String[] args) {
FramePrincipal fp=new FramePrincipal("Reiniciar...",400,50,375,260);
}
}


import java.awt.Color;
import javax.swing.*;


public class FramePrincipal extends JFrame{

private JLabel entornojl=new JLabel("Entorno");
private JLabel operadorjl=new JLabel("Operador");
private JLabel expedientejl=new JLabel("Expediente");
private JLabel espere=new JLabel("Espere...");
private JButton borrar=new JButton("Borrar");
private JTextField expedientejt=new JTextField();
protected JComboBox entornojc=new JComboBox();
private JComboBox operadorjc=new JComboBox();
private JPanel jp=new JPanel();

public FramePrincipal(String title, int x,int y,int t, int z) {
super(title);
this.setBounds(x,y,t,z);
this.setLayout(null);
this.setVisible(true);
this.addNotify();
//this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );

entornojl.setBounds(50, 30, 120, 20);
this.getContentPane().add(entornojl);
entornojc.setBounds(180, 30, 150, 20);
entornojc.addItem("Prueba");
this.getContentPane().add(entornojc);

operadorjl.setBounds(50, 70, 120, 20);
this.getContentPane().add(operadorjl);
operadorjc.setBounds(180, 70, 150, 20);
operadorjc.addItem("Prueba");
this.getContentPane().add(operadorjc);

expedientejl.setBounds(50, 110, 120, 20);
this.getContentPane().add(expedientejl);
expedientejt.setBounds(180, 110, 150, 20);
this.getContentPane().add(expedientejt);


borrar.setBounds(140, 160, 80, 20);
this.getContentPane().add(borrar);


jp.setBounds(1, 207, 357, 15);
jp.setLayout(null);
espere.setBounds(5, 1, 100, 13);
jp.add(espere);
jp.setBorder(BorderFactory.createLineBorder(Color. black));
this.getContentPane().add(jp);
}




}


El código funciona bien pero mi problema es que cuando lo ejecuto, solo me aparecen algunos componentes,tengo que minimizarlo y volverlo a maximizar y ahi recien se ven todos,alguien sabria el problema??

Gracias