elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía actualizada para evitar que un ransomware ataque tu empresa


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  Java
| | | |-+  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 3,022 veces)
Tlecoatl

Desconectado Desconectado

Mensajes: 15


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

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
problema al mover JLabel en JFrame
Java
smasher666 9 25,325 Último mensaje 30 Octubre 2009, 03:43 am
por 1mpuls0
Problema al cerrar JFrame
Java
diego_lp 2 7,608 Último mensaje 1 Junio 2010, 23:53 pm
por sapito169
ayuda con jframe
Java
include (); 4 2,703 Último mensaje 7 Noviembre 2012, 05:34 am
por ChavalChavito
Problema con JFrame
Java
.:UND3R:. 2 2,008 Último mensaje 1 Agosto 2013, 04:37 am
por .:UND3R:.
problema con jframe
Java
rocker1822 2 1,859 Último mensaje 17 Enero 2014, 14:46 pm
por ThinkByYourself
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines