Closed ErSKS closed 6 years ago
package schoollogin;
/*
@author m-lan */ public class SchoolLogin {
/**
}
}
JForm LoginSystem package schoollogin;
import javax.swing.JOptionPane;
/*
@author m-lan */ public class LoginSystem extends javax.swing.JFrame {
/**
/**
regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
//
private void initComponents() {
jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jPanel3 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); username = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); password = new javax.swing.JPasswordField(); btn_login = new javax.swing.JButton(); jCheckBox1 = new javax.swing.JCheckBox(); jLabel7 = new javax.swing.JLabel(); jButton2 = new javax.swing.JButton(); jLabel8 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Mlan Login"); setUndecorated(true);
jPanel1.setBackground(new java.awt.Color(254, 254, 254));
jPanel2.setBackground(new java.awt.Color(49, 37, 173));
jLabel2.setIcon(new javax.swing.ImageIcon("/home/m-lan/Desktop/login_icon.png")); // NOI18N
jLabel4.setFont(new java.awt.Font("DejaVu Math TeX Gyre", 1, 36)); // NOI18N jLabel4.setForeground(new java.awt.Color(254, 254, 254)); jLabel4.setText("Mlan School Login");
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap(33, Short.MAX_VALUE) .addComponent(jLabel4) .addGap(23, 23, 23)) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(97, 97, 97) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(155, 155, 155) .addComponent(jLabel2) .addGap(29, 29, 29) .addComponent(jLabel4) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) );
jPanel3.setBackground(new java.awt.Color(254, 254, 254));
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 79, Short.MAX_VALUE) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 32, Short.MAX_VALUE) );
jLabel3.setIcon(new javax.swing.ImageIcon("/home/m-lan/Desktop/image40.png")); // NOI18N
jLabel1.setIcon(new javax.swing.ImageIcon("/home/m-lan/Desktop/cross.png")); // NOI18N jLabel1.setText("jLabel1"); jLabel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel1MouseClicked(evt); } });
jLabel5.setFont(new java.awt.Font("Ubuntu Condensed", 1, 24)); // NOI18N jLabel5.setText("Password");
username.setFont(new java.awt.Font("Waree", 0, 18)); // NOI18N username.setToolTipText("Enter Username"); username.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR)); username.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { usernameActionPerformed(evt); } });
jLabel6.setFont(new java.awt.Font("Ubuntu Condensed", 1, 24)); // NOI18N jLabel6.setText("Username");
password.setFont(new java.awt.Font("Waree", 0, 18)); // NOI18N
btn_login.setBackground(new java.awt.Color(217, 172, 60)); btn_login.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N btn_login.setForeground(new java.awt.Color(254, 254, 254)); btn_login.setText("Login"); btn_login.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_loginActionPerformed(evt); } });
jCheckBox1.setBackground(new java.awt.Color(253, 251, 251)); jCheckBox1.setFont(new java.awt.Font("Waree", 1, 18)); // NOI18N jCheckBox1.setText("Remember Me"); jCheckBox1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jCheckBox1ActionPerformed(evt); } });
jLabel7.setText("Don't have account Click below to register");
jButton2.setText("Create Account");
jLabel8.setFont(new java.awt.Font("URW Gothic L", 0, 17)); // NOI18N jLabel8.setForeground(new java.awt.Color(76, 80, 233)); jLabel8.setText("Forget Password..."); jLabel8.setToolTipText("Forget Password"); jLabel8.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(34, 34, 34) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel5) .addComponent(username) .addComponent(jLabel6) .addComponent(password) .addComponent(jCheckBox1, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE)) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(65, 65, 65) .addComponent(jLabel7) .addContainerGap(66, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton2, javax.swing.GroupLayout.Alignment.TRAILING)) .addGap(152, 152, 152)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btn_login, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(166, 166, 166)))) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(14, 14, 14) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(36, 36, 36) .addComponent(jLabel6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(username, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(33, 33, 33) .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jCheckBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(btn_login, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(40, 40, 40) .addComponent(jLabel7) .addGap(18, 18, 18) .addComponent(jButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE) .addComponent(jLabel8) .addGap(35, 35, 35)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel1) .addGap(0, 0, Short.MAX_VALUE)) );
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) );
pack(); setLocationRelativeTo(null); }//
private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
dispose();
System.exit(0);
}
private void usernameActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void btn_loginActionPerformed(java.awt.event.ActionEvent evt) {
String Username;
Username = username.getText();
char[] pass = password.getPassword();
String password = new String(pass);
if ("admin".equals(Username) && "admin".equals(password)) {
Welcome w = new Welcome();
w.setVisible(true);
w.setResizable(false);
setVisible(false);
} else {
JOptionPane.showMessageDialog(null, "Wrong Username or Password");
}
// TODO add your handling code here:
}
/**
@param args the command line arguments
/
public static void main(String args[]) {
/ Set the Nimbus look and feel /
//
/ Create and display the form / java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new LoginSystem().setVisible(true); } }); }
// Variables declaration - do not modify
private javax.swing.JButton btn_login;
private javax.swing.JButton jButton2;
private javax.swing.JCheckBox jCheckBox1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPasswordField password;
private javax.swing.JTextField username;
// End of variables declaration
}
JForm Welcome /*
/*
@author m-lan */ public class Welcome extends javax.swing.JFrame {
/**
/**
regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
//
private void initComponents() {
jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setUndecorated(true);
jPanel1.setBackground(new java.awt.Color(254, 254, 254));
jLabel1.setIcon(new javax.swing.ImageIcon("/home/m-lan/Desktop/ovs_background_graphic_vectorized.png")); // NOI18N
jLabel2.setFont(new java.awt.Font("Tibetan Machine Uni", 1, 36)); // NOI18N jLabel2.setText("Welcome To Our School");
jLabel3.setIcon(new javax.swing.ImageIcon("/home/m-lan/Desktop/cross.png")); // NOI18N jLabel3.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel3MouseClicked(evt); } });
jButton1.setBackground(new java.awt.Color(194, 173, 34)); jButton1.setForeground(new java.awt.Color(254, 254, 254)); jButton1.setText("Proceed"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } });
jButton2.setBackground(new java.awt.Color(228, 66, 31)); jButton2.setForeground(new java.awt.Color(253, 251, 251)); jButton2.setText("Back"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } });
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap(159, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addComponent(jLabel2) .addGap(156, 156, 156)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addComponent(jLabel1) .addGap(243, 243, 243)) .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING))) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(306, 306, 306) .addComponent(jButton1) .addGap(39, 39, 39) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel3) .addGap(81, 81, 81) .addComponent(jLabel1) .addGap(35, 35, 35) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton2)) .addContainerGap(68, Short.MAX_VALUE)) );
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) );
pack(); setLocationRelativeTo(null); }//
private void jLabel3MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
dispose();
System.exit(0);
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
MainPage mlan = new MainPage();
mlan.setVisible(true);
mlan.setResizable(false);
setVisible(false);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
LoginSystem mlan = new LoginSystem();
mlan.setVisible(true);
setVisible(false);
}
/**
@param args the command line arguments
/
public static void main(String args[]) {
/ Set the Nimbus look and feel /
//
/ Create and display the form / java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Welcome().setVisible(true); } }); }
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel1;
// End of variables declaration
}
@milan604 Upload your full code in .zip format
code
User Login /*
/*
@author bikram */ public class UserLogin {
/**
}
user login form /*
import javax.swing.JOptionPane; import java.awt.Toolkit; import java.awt.event.WindowEvent;
import javax.swing.JOptionPane;
/*
@author bikram */ public class UserLoginForm extends javax.swing.JFrame {
private Object jtxtUserName; private Object jpassword;
/**
/**
regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
//
private void initComponents() {
jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); UnameName = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); jPassword = new javax.swing.JTextField(); jCheckBox1 = new javax.swing.JCheckBox(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jLabel4 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton(); jLabel5 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setBackground(java.awt.Color.blue);
jPanel1.setBackground(java.awt.Color.white); jPanel1.setForeground(new java.awt.Color(153, 204, 255)); jPanel1.setDebugGraphicsOptions(javax.swing.DebugGraphics.LOG_OPTION);
jLabel1.setBackground(java.awt.Color.blue); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel1.setIcon(new javax.swing.ImageIcon("C:\Users\bikram\Desktop\th.jpg")); // NOI18N
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE) .addGap(30, 30, 30)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) );
jPanel2.setBackground(java.awt.Color.cyan); jPanel2.setFont(new java.awt.Font("Tahoma", 1, 8)); // NOI18N
jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 10)); // NOI18N jLabel2.setText("UserName");
jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 10)); // NOI18N jLabel3.setText("PassWord");
jCheckBox1.setFont(new java.awt.Font("Times New Roman", 1, 8)); // NOI18N jCheckBox1.setText("Remember Me");
jButton1.setBackground(new java.awt.Color(102, 153, 255)); jButton1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jButton1.setText("Signup"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } });
jButton2.setBackground(new java.awt.Color(0, 153, 255)); jButton2.setText("CreatNew");
jLabel4.setForeground(java.awt.Color.blue); jLabel4.setText("Forget password.....");
jButton3.setBackground(new java.awt.Color(204, 204, 204)); jButton3.setText("Exit"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } });
jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel5.setForeground(java.awt.SystemColor.textHighlight); jLabel5.setText("Wel Come To Guru Education");
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(33, 33, 33) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(UnameName) .addComponent(jPassword) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jCheckBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(13, 13, 13) .addComponent(jButton1))) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(29, 29, 29) .addComponent(jLabel4)) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(12, 12, 12) .addComponent(jButton2) .addGap(18, 18, 18) .addComponent(jButton3))))) .addGap(22, 22, 22)) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(25, 25, 25) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(19, 19, 19) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(UnameName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel3) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jCheckBox1)) .addComponent(jLabel4)) .addGap(46, 46, 46) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton2) .addComponent(jButton3)) .addContainerGap(71, Short.MAX_VALUE)) );
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(35, 35, 35) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(319, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(24, 24, 24)) );
pack(); setLocationRelativeTo(null); }//
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
System.exit(0);
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
/**
/**
@param args the command line arguments
/
public static void main(String args[]) {
/ Set the Nimbus look and feel /
//
/ Create and display the form / java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new UserLoginForm().setVisible(true); } }); }
// Variables declaration - do not modify
private javax.swing.JTextField UnameName;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JCheckBox jCheckBox1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JTextField jPassword;
// End of variables declaration
}
sign in
/*
/*
@author bikram */ public class SignIn extends javax.swing.JFrame {
/**
/**
regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
//
private void initComponents() {
jLabel1 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setIcon(new javax.swing.ImageIcon("C:\Users\bikram\Desktop\th (1).jpg")); // NOI18N
jButton1.setBackground(new java.awt.Color(153, 204, 255)); jButton1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jButton1.setForeground(new java.awt.Color(102, 204, 255)); jButton1.setText("Next");
jButton2.setBackground(new java.awt.Color(255, 255, 255)); jButton2.setForeground(new java.awt.Color(51, 255, 255)); jButton2.setText("Back"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } });
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addGap(28, 28, 28) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 111, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton2)) .addGap(42, 42, 42)) );
pack(); }//
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
UserLoginForm obj = new UserLoginForm();
obj.setVisible(true);
SignIn obj1 = new SignIn();
obj1.setVisible(false);
}
/**
@param args the command line arguments
/
public static void main(String args[]) {
/ Set the Nimbus look and feel /
//
/ Create and display the form / java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new SignIn().setVisible(true); } }); }
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
// End of variables declaration
}
Try to build Java UI fetching some concepts from this page: http://www.jroller.com/DhilshukReddy/