elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
27 Mayo 2012, 23:39  


Tema destacado: Recuperar cuenta de Google, GMail, Youtube

+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  Java (Moderadores: Debci, Leyer)
| | | |-+  Problema con JFrame
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Problema con JFrame  (Leído 1,128 veces)
Tlecoatl

Desconectado Desconectado

Mensajes: 15


Ver Perfil
Problema con JFrame
« en: 30 Abril 2011, 23:22 »

Buen dia!!!
Tengo una duda sobre un Frame que realice para la creacion de unos graficos. Mi unico problema es que, cuando mando llamar al selector de figuras (un dialog) no se crea la figura....en cambio cuando ejecuto el JDialog y despues el frame este si me ejecuta la graficacion!!! alguien sabe porque??? Si me pudieran ayudar se los agradeceria. Lo que deseo es que al entrar al jdialog desde el frame y seleccionar la figura me regrese al JFrame que lo llamo con la figura ya dibujada...

Aqui el codigo que llevo..

Código:

private void etAreaMouseClicked(java.awt.event.MouseEvent evt) {                                   
        // TODO add your handling code here:
        SeleccionFigura obj = new SeleccionFigura(this, true);
        obj.setVisible(true);

    }

Código:
private void btnGraficarActionPerformed(java.awt.event.ActionEvent evt) {                                           
        // TODO add your handling code here:
        int figurin;

        if (this.RadioCasa.isSelected()) {
            figurin = 1;
            Bienvenida obj = new Bienvenida(figurin);
            obj.setVisible(true);
            this.dispose();
        } else if (this.RadioCubo.isSelected()) {
            figurin = 2;
            Bienvenida obj = new Bienvenida(figurin);
            obj.setVisible(true);
           
        } else if (this.RadioPiramide.isSelected()) {
            figurin = 3;
            Bienvenida obj = new Bienvenida(figurin);
            obj.setVisible(true);
            this.dispose();
        } else if (this.RadioRectangular.isSelected()) {
            figurin = 4;
            Bienvenida obj = new Bienvenida(figurin);
            obj.setVisible(true);
            this.dispose();
        }

    }                   

Cabe destacar que ya tengo dos constructores en el frame uno con parametros y otro sin parametros
Código:
public Bienvenida() {
        super("Graficación 3D");
        initComponents();
        setLocationRelativeTo(null);
        this.Herramientas.setVisible(false);
        this.Herramientas2.setVisible(false);
        this.AreaTrabajo.setVisible(true);
        this.PanelCartesiano.setVisible(true);

        plano = new PlanoCartesiano(this.PanelCartesiano.getSize());
        plano.setBackground(Color.WHITE);
        PanelCartesiano.add(plano);
        PanelCartesiano.repaint();
    }

    public Bienvenida(int figura) {
        super("Graficación 3D");
        initComponents();
        setLocationRelativeTo(null);
        this.Herramientas.setVisible(false);
        this.Herramientas2.setVisible(false);
        this.AreaTrabajo.setVisible(true);
        this.PanelCartesiano.setVisible(true);
        this.figura = figura;

        plano = new PlanoCartesiano(this.PanelCartesiano.getSize(),figura);
        plano.setBackground(Color.WHITE);
        PanelCartesiano.add(plano);
        PanelCartesiano.repaint();
    }

De antemano muchas gracias por su pronta respuesta ;)


En línea
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Duda: como mostrar un JFrame de otro JFrame.
Programación General
dragon_abraxas 0 1,042 Último mensaje 22 Octubre 2004, 12:10
por dragon_abraxas
problema al mover JLabel en JFrame
Java
smasher666 9 5,760 Último mensaje 30 Octubre 2009, 03:43
por Darhius
JFrame MDI
Java
[GB] 0 1,449 Último mensaje 23 Noviembre 2009, 23:34
por [GB]
JFrame
Java
nerckos 10 2,314 Último mensaje 8 Mayo 2010, 15:58
por nerckos
Problema al cerrar JFrame
Java
diego_lp 2 3,041 Último mensaje 1 Junio 2010, 23:53
por sapito169
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines