Jdialog Help needed in JApplet

i have program and opens a dialog after click on a button. but dialog hides if applet is clicked. i need applet clickable but dialog should be on top of applet. I checked How To make Dialog in http://java.sun.com/j2se/1.5.0/docs/api/ and found the sample is very good but is complecated for me understand Framing explanation given.

Can some one please change/guide me on this program ?

thanks

import javax.swing.*;

publicclass NewJAppletextends javax.swing.JApplet{

JFrame frame ;

/** Initializes the applet NewJApplet */

publicvoid init(){

try{

java.awt.EventQueue.invokeAndWait(new Runnable(){

publicvoid run(){

initComponents();

}

});

}catch(Exception e){}

}

// <editor-fold defaultstate="collapsed" desc=" Generated Code ">

privatevoid initComponents(){

jButton1 =new javax.swing.JButton();

jButton1.setText("jButton1");

jButton1.addMouseListener(new java.awt.event.MouseAdapter(){

publicvoid mouseClicked(java.awt.event.MouseEvent evt){

jButton1MouseClicked(evt);

}

});

getContentPane().add(jButton1, java.awt.BorderLayout.CENTER);

}// </editor-fold>

privatevoid jButton1MouseClicked(java.awt.event.MouseEvent evt){

JDialog jd =new JDialog();

jd.setVisible(true);

}

// Variables declaration - do not modify

private javax.swing.JButton jButton1;

// End of variables declaration

}

[2946 byte] By [harry_singha] at [2007-11-27 10:16:45]
# 1

Try using this method:

public void mensaje(String estado){

JOptionPane.showMessageDialog(this,estado);

}

ErnestoCarloa at 2007-7-28 15:47:28 > top of Java-index,Desktop,Core GUI APIs...