Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package vistas;
- import Conexion.logOut;
- import Conexion.loginSesion;
- import java.io.IOException;
- import java.net.Socket;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- /**
- *
- * @author dario
- */
- public class vistaAdmin extends javax.swing.JFrame {
- /**
- * Creates new form vistaAdmin
- */
- public vistaAdmin() {
- initComponents();
- this.setLocationRelativeTo(null);
- lbUser.setText(loginSesion.user);
- lbTipo.setText(loginSesion.puesto);
- }
- /**
- * 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() {
- jPanel1 = new javax.swing.JPanel();
- jLabel1 = new javax.swing.JLabel();
- jLabel2 = new javax.swing.JLabel();
- jLabel3 = new javax.swing.JLabel();
- jLabel4 = new javax.swing.JLabel();
- lbUser = new javax.swing.JLabel();
- lbTipo = new javax.swing.JLabel();
- jLabel5 = new javax.swing.JLabel();
- btnChat = new javax.swing.JButton();
- jMenuBar1 = new javax.swing.JMenuBar();
- jMenu1 = new javax.swing.JMenu();
- jMenuItem1 = new javax.swing.JMenuItem();
- jMenuItem2 = new javax.swing.JMenuItem();
- jMenu2 = new javax.swing.JMenu();
- jMenuItem3 = new javax.swing.JMenuItem();
- jMenuItem4 = new javax.swing.JMenuItem();
- jMenu4 = new javax.swing.JMenu();
- jMenuItem6 = new javax.swing.JMenuItem();
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- setBackground(new java.awt.Color(255, 255, 255));
- setSize(new java.awt.Dimension(800, 600));
- getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
- jPanel1.setBackground(new java.awt.Color(255, 255, 255));
- jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
- jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/log0.png"))); // NOI18N
- jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 100, -1, -1));
- jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 10, -1, -1));
- jLabel3.setFont(new java.awt.Font("Montserrat Black", 1, 12)); // NOI18N
- jLabel3.setForeground(new java.awt.Color(122, 14, 2));
- jLabel3.setText("USUARIO:");
- jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 30, -1, -1));
- jLabel4.setFont(new java.awt.Font("Montserrat Black", 1, 12)); // NOI18N
- jLabel4.setForeground(new java.awt.Color(122, 14, 2));
- jLabel4.setText("ROL:");
- jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 50, -1, -1));
- lbUser.setFont(new java.awt.Font("Montserrat ExtraBold", 0, 12)); // NOI18N
- lbUser.setForeground(new java.awt.Color(122, 14, 2));
- jPanel1.add(lbUser, new org.netbeans.lib.awtextra.AbsoluteConstraints(640, 30, -1, -1));
- lbTipo.setFont(new java.awt.Font("Montserrat ExtraBold", 0, 12)); // NOI18N
- lbTipo.setForeground(new java.awt.Color(122, 14, 2));
- jPanel1.add(lbTipo, new org.netbeans.lib.awtextra.AbsoluteConstraints(640, 50, -1, -1));
- jLabel5.setFont(new java.awt.Font("Montserrat ExtraBold", 0, 12)); // NOI18N
- jLabel5.setForeground(new java.awt.Color(122, 14, 2));
- jLabel5.setText("SALIR");
- jLabel5.setToolTipText("");
- jLabel5.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
- jLabel5.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseClicked(java.awt.event.MouseEvent evt) {
- jLabel5MouseClicked(evt);
- }
- });
- jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(680, 70, -1, -1));
- btnChat.setBackground(new java.awt.Color(255, 255, 255));
- btnChat.setFont(new java.awt.Font("Montserrat ExtraBold", 0, 14)); // NOI18N
- btnChat.setForeground(new java.awt.Color(114, 22, 2));
- btnChat.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/icons8_chat_30px.png"))); // NOI18N
- btnChat.setText("Chat");
- btnChat.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(114, 22, 2), 1, true));
- btnChat.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnChatActionPerformed(evt);
- }
- });
- jPanel1.add(btnChat, new org.netbeans.lib.awtextra.AbsoluteConstraints(1060, 500, 120, 50));
- getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 800, 560));
- jMenuBar1.setBackground(new java.awt.Color(255, 255, 255));
- jMenuBar1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- jMenuBar1.setForeground(new java.awt.Color(122, 14, 2));
- jMenuBar1.setFont(new java.awt.Font("Montserrat", 1, 12)); // NOI18N
- jMenu1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/icons8_management_30px.png"))); // NOI18N
- jMenu1.setText("Empleados");
- jMenu1.setFont(new java.awt.Font("Montserrat Black", 0, 12)); // NOI18N
- jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK));
- jMenuItem1.setBackground(new java.awt.Color(255, 255, 255));
- jMenuItem1.setFont(new java.awt.Font("Montserrat Light", 0, 12)); // NOI18N
- jMenuItem1.setForeground(new java.awt.Color(122, 14, 2));
- jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/icons8_member_30px_1.png"))); // NOI18N
- jMenuItem1.setText("Agregar");
- jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jMenuItem1ActionPerformed(evt);
- }
- });
- jMenu1.add(jMenuItem1);
- jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.ALT_MASK));
- jMenuItem2.setFont(new java.awt.Font("Montserrat Light", 0, 12)); // NOI18N
- jMenuItem2.setForeground(new java.awt.Color(122, 14, 2));
- jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/icons8_delete_user_male_30px_1.png"))); // NOI18N
- jMenuItem2.setText("Eliminar");
- jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jMenuItem2ActionPerformed(evt);
- }
- });
- jMenu1.add(jMenuItem2);
- jMenuBar1.add(jMenu1);
- jMenu2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/icons8_task_30px.png"))); // NOI18N
- jMenu2.setText("Pedidos");
- jMenu2.setFont(new java.awt.Font("Montserrat Black", 0, 12)); // NOI18N
- jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.ALT_MASK));
- jMenuItem3.setBackground(new java.awt.Color(255, 255, 255));
- jMenuItem3.setFont(new java.awt.Font("Montserrat Light", 0, 12)); // NOI18N
- jMenuItem3.setForeground(new java.awt.Color(122, 14, 2));
- jMenuItem3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/icons8_spring_30px_2.png"))); // NOI18N
- jMenuItem3.setText("Arreglos");
- jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jMenuItem3ActionPerformed(evt);
- }
- });
- jMenu2.add(jMenuItem3);
- jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.ALT_MASK));
- jMenuItem4.setFont(new java.awt.Font("Montserrat Light", 0, 12)); // NOI18N
- jMenuItem4.setForeground(new java.awt.Color(122, 14, 2));
- jMenuItem4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/icons8_job_30px.png"))); // NOI18N
- jMenuItem4.setText("Asignaciónes");
- jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jMenuItem4ActionPerformed(evt);
- }
- });
- jMenu2.add(jMenuItem4);
- jMenuBar1.add(jMenu2);
- jMenu4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/icons8_member_30px.png"))); // NOI18N
- jMenu4.setText("Comunicacion");
- jMenu4.setFont(new java.awt.Font("Montserrat Black", 0, 12)); // NOI18N
- jMenuItem6.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.ALT_MASK));
- jMenuItem6.setBackground(new java.awt.Color(255, 255, 255));
- jMenuItem6.setFont(new java.awt.Font("Montserrat Light", 0, 12)); // NOI18N
- jMenuItem6.setForeground(new java.awt.Color(122, 14, 2));
- jMenuItem6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/icons8_chat_30px.png"))); // NOI18N
- jMenuItem6.setText("Chat");
- jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jMenuItem6ActionPerformed(evt);
- }
- });
- jMenu4.add(jMenuItem6);
- jMenuBar1.add(jMenu4);
- setJMenuBar(jMenuBar1);
- pack();
- }// </editor-fold>
- private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
- new frmEmpleados(this, true).setVisible(true);
- }
- private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
- new frmBorrarEmp(this, true).setVisible(true);
- }
- private void jLabel5MouseClicked(java.awt.event.MouseEvent evt) {
- login login= new login();
- logOut.logout(this, login);
- }
- private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {
- new frmCatalogoArreglo(this, true).setVisible(true);
- }
- private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {
- new frmAsignacion (this, true).setVisible(true);
- }
- private void btnChatActionPerformed(java.awt.event.ActionEvent evt) {
- try {
- String user = Conexion.loginSesion.user;
- Socket s= new Socket("localhost", 5000);
- new controlador.ClientView(user, s).setVisible(true);
- } catch (IOException ex) {
- Logger.getLogger(vistaSupervisor.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {
- try {
- String user = Conexion.loginSesion.user;
- Socket s= new Socket("localhost", 5000);
- new controlador.ClientView(user, s).setVisible(true);
- } catch (IOException ex) {
- Logger.getLogger(vistaSupervisor.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- /**
- * @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(vistaAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (InstantiationException ex) {
- java.util.logging.Logger.getLogger(vistaAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (IllegalAccessException ex) {
- java.util.logging.Logger.getLogger(vistaAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (javax.swing.UnsupportedLookAndFeelException ex) {
- java.util.logging.Logger.getLogger(vistaAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- //</editor-fold>
- /* Create and display the form */
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new vistaAdmin().setVisible(true);
- }
- });
- }
- // Variables declaration - do not modify
- private javax.swing.JButton btnChat;
- 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.JMenu jMenu1;
- private javax.swing.JMenu jMenu2;
- private javax.swing.JMenu jMenu4;
- private javax.swing.JMenuBar jMenuBar1;
- private javax.swing.JMenuItem jMenuItem1;
- private javax.swing.JMenuItem jMenuItem2;
- private javax.swing.JMenuItem jMenuItem3;
- private javax.swing.JMenuItem jMenuItem4;
- private javax.swing.JMenuItem jMenuItem6;
- private javax.swing.JPanel jPanel1;
- private javax.swing.JLabel lbTipo;
- private javax.swing.JLabel lbUser;
- // End of variables declaration
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement