/** This method is called from within the constructor to * initialize the form. */ private void initComponents() { okButton = new javax.swing.JButton(); errorLbl = new javax.swing.JLabel(); okButton.setAlignmentX (CENTER_ALIGNMENT); errorLbl.setAlignmentX (CENTER_ALIGNMENT); getContentPane().setLayout (new javax.swing.BoxLayout (getContentPane (),BoxLayout.Y_AXIS)); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); okButton.setActionCommand("okButton"); okButton.setText("OK"); okButton.addActionListener (new ActionListener (){ public void actionPerformed (ActionEvent e){ dispose (); } }); super.addWindowListener (new WindowAdapter (){ public void windowClosing (WindowEvent we){ dispose (); } }); errorLbl.setText("Error : "+message); getContentPane().add (errorLbl); getContentPane().add (okButton); }
/** This method is called from within the constructor to * initialize the form. */ private void initComponents() { okButton = new javax.swing.JButton(); errorLbl = new javax.swing.JLabel(); okButton.setAlignmentX (CENTER_ALIGNMENT); errorLbl.setAlignmentX (CENTER_ALIGNMENT); getContentPane().setLayout (new javax.swing.BoxLayout (getContentPane (),BoxLayout.Y_AXIS)); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); okButton.setActionCommand("okButton"); okButton.setText("OK"); okButton.addActionListener (new ActionListener (){ public void actionPerformed (ActionEvent e){ dispose (); } }); super.addWindowListener (new WindowAdapter (){ public void windowClosing (WindowEvent we){ dispose (); } }); errorLbl.setText("Error : "+message); getContentPane().add (errorLbl); getContentPane().add (okButton); }