/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * LoginTest.java * * Created on Nov 30, 2009, 8:21:02 AM */ package grader.UI.file; /** * * @author Nick */ public class Login extends javax.swing.JDialog { /** Creates new form LoginTest */ public Login(java.awt.Frame parent, boolean modal) { super(parent, modal); 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. */ @SuppressWarnings("unchecked") // private void initComponents() { login = new javax.swing.JButton(); cancel = new javax.swing.JButton(); password_field = new javax.swing.JPasswordField(); login_text = new javax.swing.JLabel(); username = new javax.swing.JLabel(); password = new javax.swing.JLabel(); remember = new javax.swing.JCheckBox(); username_field = new javax.swing.JTextField(); server_field = new javax.swing.JTextField(); server = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setName("Form"); // NOI18N login.setText("Login"); // NOI18N login.setName("login"); // NOI18N cancel.setText("Cancel"); // NOI18N cancel.setName("cancel"); // NOI18N password_field.setText("fishsticks"); // NOI18N password_field.setName("password_field"); // NOI18N login_text.setText("Login"); // NOI18N login_text.setName("login_text"); // NOI18N username.setText("Username"); // NOI18N username.setName("username"); // NOI18N password.setText("Password"); // NOI18N password.setName("password"); // NOI18N remember.setText("Remember"); // NOI18N remember.setName("remember"); // NOI18N username_field.setText("gfisher"); // NOI18N username_field.setName("username_field"); // NOI18N server_field.setText("server.calpoly.edu"); // NOI18N server_field.setName("server_field"); // NOI18N server.setText("Server"); // NOI18N server.setName("server"); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(login) .addGap(61, 61, 61) .addComponent(cancel)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addGap(70, 70, 70) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(remember) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(server) .addComponent(password) .addComponent(username)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(password_field, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(username_field, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE) .addComponent(server_field, javax.swing.GroupLayout.Alignment.LEADING)))))) .addGroup(layout.createSequentialGroup() .addGap(177, 177, 177) .addComponent(login_text))) .addContainerGap(87, Short.MAX_VALUE)) ); layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cancel, login}); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(22, 22, 22) .addComponent(login_text) .addGap(34, 34, 34) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(username_field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(username)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(password_field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(password)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(server_field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(server)) .addGap(18, 18, 18) .addComponent(remember) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cancel) .addComponent(login)) .addContainerGap()) ); pack(); }// /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { Login dialog = new Login(new javax.swing.JFrame(), true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton cancel; private javax.swing.JButton login; private javax.swing.JLabel login_text; private javax.swing.JLabel password; private javax.swing.JPasswordField password_field; private javax.swing.JCheckBox remember; private javax.swing.JLabel server; private javax.swing.JTextField server_field; private javax.swing.JLabel username; private javax.swing.JTextField username_field; // End of variables declaration }