Here is the code for the login class
Code:
/*
* Login.java
*
* Created on 18 January 2006, 16:55
*/
/**
*
* @author jonathan
*/
class Login extends javax.swing.JFrame implements java.awt.event.ActionListener {
/** Creates new form Login */
public Login() {
initComponents();
}
/** 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.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
jLayeredPane1 = new javax.swing.JLayeredPane();
jButton1 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jButton2 = new javax.swing.JButton();
jPasswordField1 = new javax.swing.JPasswordField();
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jButton1.setText("Login");
getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 220, -1, -1));
jLabel1.setText("Username");
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 120, -1, -1));
jLabel2.setText("Password");
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 150, 50, -1));
jTextField1.addActionListener(this);
getContentPane().add(jTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 120, 170, -1));
jButton2.setText("Register");
jButton2.addActionListener(this);
getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 220, -1, -1));
getContentPane().add(jPasswordField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 150, 170, 20));
pack();
}
// Code for dispatching events from components to event handlers.
public void actionPerformed(java.awt.event.ActionEvent evt) {
if (evt.getSource() == jButton2) {
Login.this.jButton2ActionPerformed(evt);
}
else if (evt.getSource() == jTextField1) {
Login.this.jTextField1ActionPerformed(evt);
}
}
// </editor-fold>
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
// java.awt.EventQueue.invokeLater(new Runnable() {
// public void run() {
// new Login().setVisible(true);
// }
//});
}
// Variables declaration - do not modify
public javax.swing.JButton jButton1;
public javax.swing.JButton jButton2;
public javax.swing.JLabel jLabel1;
public javax.swing.JLabel jLabel2;
public javax.swing.JLayeredPane jLayeredPane1;
public javax.swing.JPasswordField jPasswordField1;
public javax.swing.JTextField jTextField1;
// End of variables declaration
}