FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
||||
|
||||
Ayuda con JInternalFrame
Holassssss, necesito ayuda sobre el JInternalFrame, lo q quiero hacer es como una pagina HTML con un IFRAME, lo mismo quiero hacer en JAVA, la ventana es un JFrame y quiero poner un JInternalFrame q seria como el iframe en HTML, pero ya busque en Google me lei tutoriale y no tengi todavia como lograrlo.
La idea es q en una ventana con varios botones al hacer click en uno de ellos q se cargue una subventana como en html con el iframe, espero haberme explicado bien.
__________________
Todo el Mal Que Me Hagas A Ti Te Lo Haras |
#2
|
|||
|
|||
Ayuda con JInternalFrame
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JInternalFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; public class FormaInterna extends JInternalFrame implements Client { private JTextArea txtArea=new JTextArea(); /** * Constructor */ public FormaInterna(){ super("Forma Interna", true, true, true, true); //AQUI SE DEBE INICIALIZAR EL OBJETO MEDIATOR JPanel panel=(JPanel)this.getContentPane(); panel.setLayout(new BoxLayout(panel,BoxLayout.PAGE_AXIS)); panel.setBorder(BorderFactory.createEmptyBorder(15,15,15,15)); JButton btnEnvioMensaje=new JButton("Interno"); btnEnvioMensaje.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent event) { //AÑADIR LA INVOCACION AL METODO DE ENVIO DE MENSAJES //broadcastEvent(); } }); JPanel panelBotones=new JPanel(); panelBotones.setLayout(new BoxLayout(panelBotones,BoxLayout.LINE_AXIS)); panelBotones.add(btnEnvioMensaje); panel.add(panelBotones); panel.add(Box.createRigidArea(new Dimension(0,10))); panel.add(new JScrollPane(txtArea)); this.setSize(new Dimension(300,300)); this.setVisible(true); } public void handleEvent() { // TODO Auto-generated method stub txtArea.setText(txtArea.getText() + "Recibiendo Notificacion\r\n" ); } public void broadcastEvent() { // TODO Auto-generated method stub txtArea.setText(txtArea.getText() + "Enviando Notificacion\r\n"); mediator.broadcastEvent(); } } Genera esta clase. y al boton del Frame ponle el siguiente codigo FormaInterna frame = new FormaInterna(); frame.setVisible(true); desktop.add(frame); try { frame.setSelected(true); } catch (java.beans.PropertyVetoException e) {} Saludos |
Herramientas | Buscar en Tema |
Desplegado | |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Instalar Ayuda (.HLP) en la Ayuda de Delphi? | MasterXP | Varios | 6 | 12-04-2006 06:57:49 |
Ayuda para crear ayuda... | Gabriel2 | Varios | 2 | 10-06-2005 00:15:18 |
Leer la ayuda... Ayuda! | MaJeSTiC | Varios | 0 | 04-08-2004 21:24:42 |
ayuda con strtofloat, ayuda punto flotante | TURING | Varios | 5 | 30-04-2004 08:03:59 |
Ayuda Con Instalacion De Archivos De Ayuda | Legolas | Varios | 1 | 01-12-2003 14:48:03 |
|