Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 5

/*

* To change this license header, choose License Headers in Project Properties.


* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author Malanay
*/
public class EmployeeAdmin extends javax.swing.JFrame {

/**
* Creates new form EmployeeAdmin
*/
public EmployeeAdmin() {
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")
// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

jLabel1 = new javax.swing.JLabel();


jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
emp = new javax.swing.JLabel();
admin = new javax.swing.JLabel();
empbttn = new javax.swing.JButton();
adminbttn = new javax.swing.JButton();
back_bttn = new javax.swing.JButton();
logt_bttn = new javax.swing.JButton();

jLabel1.setText("jLabel1");

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBackground(new java.awt.Color(216, 225, 230));

jPanel1.setBackground(new java.awt.Color(216, 225, 230));


jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null,
"Welcome", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Lucida Sans
Unicode", 1, 18))); // NOI18N
jPanel1.setToolTipText("Welcome");

jLabel2.setFont(new java.awt.Font("Lucida Fax", 0, 18)); // NOI18N


jLabel2.setText("Please select user:");

emp.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
empMouseClicked(evt);
}
});
admin.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
adminMouseClicked(evt);
}
});

empbttn.setIcon(new javax.swing.ImageIcon("C:\\Users\\Malanay\\Desktop\\
Sample2\\id-card.png")); // NOI18N
empbttn.setText("EMPLOYEE");
empbttn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
empbttnActionPerformed(evt);
}
});

adminbttn.setIcon(new javax.swing.ImageIcon("C:\\Users\\Malanay\\Desktop\\
Sample2\\unauthorized-person.png")); // NOI18N
adminbttn.setText("ADMIN");
adminbttn.setToolTipText("");
adminbttn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
adminbttnActionPerformed(evt);
}
});

back_bttn.setIcon(new javax.swing.ImageIcon("C:\\Users\\Malanay\\Desktop\\
Sample2\\first.png")); // NOI18N
back_bttn.setText("BACK");
back_bttn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
back_bttnActionPerformed(evt);
}
});

logt_bttn.setIcon(new javax.swing.ImageIcon("C:\\Users\\Malanay\\Desktop\\
Sample2\\logout.png")); // NOI18N
logt_bttn.setText("LOGOUT");
logt_bttn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
logt_bttnActionPerformed(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()
.addGap(23, 23, 23)
.addComponent(empbttn, javax.swing.GroupLayout.PREFERRED_SIZE, 241,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(adminbttn, javax.swing.GroupLayout.PREFERRED_SIZE,
237, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED
)
.addComponent(emp)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED
, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(admin)
.addGap(68, 68, 68))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(35, 35, 35)
.addComponent(jLabel2)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(back_bttn, javax.swing.GroupLayout.PREFERRED_SIZE,
104, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED
)
.addComponent(logt_bttn, javax.swing.GroupLayout.PREFERRED_SIZE,
104, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(45, 45, 45))
);
jPanel1Layout.setVerticalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout
.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(44, 44, 44)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.LEADING)
.addComponent(emp)
.addComponent(admin,
javax.swing.GroupLayout.PREFERRED_SIZE, 137,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement
.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.BASELINE)
.addComponent(empbttn,
javax.swing.GroupLayout.PREFERRED_SIZE, 188,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(adminbttn,
javax.swing.GroupLayout.PREFERRED_SIZE, 188,
javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout
.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(back_bttn))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(logt_bttn,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addGap(4, 4, 4)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
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.PREFERRED_SIZE, 571,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
);

pack();
}// </editor-fold>

private void empMouseClicked(java.awt.event.MouseEvent evt) {

private void adminMouseClicked(java.awt.event.MouseEvent evt) {

// TODO add your handling code here:


}

private void empbttnActionPerformed(java.awt.event.ActionEvent evt) {

DataRecord hp= new DataRecord();


hp.show();
dispose();
DataRecord.save_bttn.setEnabled(false);
DataRecord.canceln_bttn.setEnabled(false);
}

private void adminbttnActionPerformed(java.awt.event.ActionEvent evt) {

Admin hp= new Admin();


hp.show();
dispose();
}

private void back_bttnActionPerformed(java.awt.event.ActionEvent evt) {

EmployeeAdmin hp = new EmployeeAdmin();


hp.show();
dispose();
}

private void logt_bttnActionPerformed(java.awt.event.ActionEvent evt) {

LogIn hp = new LogIn();


hp.show();
dispose();
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the
default look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(EmployeeAdmin.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(EmployeeAdmin.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(EmployeeAdmin.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(EmployeeAdmin.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(() -> {
new EmployeeAdmin().setVisible(true);
});
}

// Variables declaration - do not modify


private javax.swing.JLabel admin;
private javax.swing.JButton adminbttn;
private javax.swing.JButton back_bttn;
private javax.swing.JLabel emp;
private javax.swing.JButton empbttn;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JButton logt_bttn;
// End of variables declaration
}

You might also like