import javax.swing.JFrame; import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import java.util.*; /* * Foobar.java * * Created on February 12, 2001, 12:57 AM */ /** * * @author kees * @version */ public class Foobar extends javax.swing.JDialog { /** Creates new form Foobar */ public Foobar(java.awt.Frame parent,boolean modal) { super (parent, modal); initComponents (); pack (); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the FormEditor. */ private void initComponents () {//GEN-BEGIN:initComponents getContentPane ().setLayout (new java.awt.GridBagLayout ()); java.awt.GridBagConstraints gridBagConstraints1; addMouseListener (new java.awt.event.MouseAdapter () { public void mouseClicked (java.awt.event.MouseEvent evt) { formMouseClicked (evt); } } ); addWindowListener (new java.awt.event.WindowAdapter () { public void windowClosing (java.awt.event.WindowEvent evt) { closeDialog (evt); } } ); }//GEN-END:initComponents private void formMouseClicked (java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked // Add your handling code here: }//GEN-LAST:event_formMouseClicked /** Closes the dialog */ private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog setVisible (false); dispose (); }//GEN-LAST:event_closeDialog /** * @param args the command line arguments */ public static void main (String args[]) { javax.swing.JFrame frame = new javax.swing.JFrame(); frame.setSize(new Dimension(400,400)); new Foobar (frame, true).show (); } // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables }