/* * DBpw.java * * Created on den 4 augusti 2002, 12:50 */ /** * * @author h&m */ import java.awt.event.*; public class DBpw extends java.awt.Dialog implements ActionListener { private DBApplets parent; /** Creates new form DBpw */ // public DBpw(java.awt.Frame parent, boolean modal) { public DBpw(DBApplets parent, String username) { super(new java.awt.Frame(), "password", true); this.parent = parent; initComponents(); user.setText(username); okbutton.addActionListener(this); } public void actionPerformed(ActionEvent ae) { if(ae.getSource() == okbutton) parent.setPassword(pw.getText()); } /** 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 Form Editor. */ private void initComponents() {//GEN-BEGIN:initComponents label = new java.awt.Label(); user = new java.awt.Label(); pw = new java.awt.TextField(); okbutton = new java.awt.Button(); setLayout(new java.awt.GridBagLayout()); java.awt.GridBagConstraints gridBagConstraints1; addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); label.setText("Please insert password for "); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.anchor = java.awt.GridBagConstraints.EAST; add(label, gridBagConstraints1); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.anchor = java.awt.GridBagConstraints.WEST; add(user, gridBagConstraints1); pw.setEchoChar('*'); pw.setColumns(15); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.gridx = 0; gridBagConstraints1.gridy = 1; gridBagConstraints1.gridwidth = 2; add(pw, gridBagConstraints1); okbutton.setLabel("OK"); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.gridx = 0; gridBagConstraints1.gridy = 2; gridBagConstraints1.gridwidth = 2; add(okbutton, gridBagConstraints1); pack(); }//GEN-END:initComponents /** Closes the dialog */ private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog }//GEN-LAST:event_closeDialog // Variables declaration - do not modify//GEN-BEGIN:variables private java.awt.Label label; private java.awt.Label user; private java.awt.TextField pw; private java.awt.Button okbutton; // End of variables declaration//GEN-END:variables }