Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package login;
- import java.awt.Color;
- import java.sql.*;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import javax.swing.JOptionPane;
- public class Principal extends javax.swing.JFrame {
- /** Creates new form Principal */
- public Principal() {
- initComponents();
- new Splash().run();
- Dialogo.setSize(400,200);
- Dialogo.setTitle("Bienvendio.");
- Dialogo.setLocationRelativeTo(this);
- Dialogo.setVisible(true);
- }
- @SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">
- private void initComponents() {
- Dialogo = new javax.swing.JDialog();
- txtUsers = new javax.swing.JTextField();
- jLabel1 = new javax.swing.JLabel();
- jLabel2 = new javax.swing.JLabel();
- btnEntrar = new javax.swing.JButton();
- btnCerrar = new javax.swing.JButton();
- txtPassword = new javax.swing.JPasswordField();
- jLabel3 = new javax.swing.JLabel();
- DialogoSplash = new javax.swing.JDialog();
- jLabel4 = new javax.swing.JLabel();
- PanelPrincipal = new javax.swing.JPanel();
- btnPrincipalPacientes = new javax.swing.JButton();
- btnPrincipalContabilidad = new javax.swing.JButton();
- btnPrincipalAgenda = new javax.swing.JButton();
- btnPrincipalUsuario = new javax.swing.JButton();
- btnPrincipalResumen = new javax.swing.JButton();
- btnPrincipalInformacion = new javax.swing.JButton();
- btnPrincipalHerramientas = new javax.swing.JButton();
- btnPrincipalAyuda = new javax.swing.JButton();
- lblInformacion = new javax.swing.JLabel();
- btnPrincipalAjustes = new javax.swing.JButton();
- Dialogo.setTitle("");
- Dialogo.setIconImage(null);
- Dialogo.setMinimumSize(new java.awt.Dimension(500, 100));
- Dialogo.addWindowListener(new java.awt.event.WindowAdapter() {
- public void windowClosing(java.awt.event.WindowEvent evt) {
- DialogoWindowClosing(evt);
- }
- });
- txtUsers.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- txtUsersActionPerformed(evt);
- }
- });
- jLabel1.setText("Usuario:");
- jLabel2.setText("Clave:");
- btnEntrar.setText("Entrar");
- btnEntrar.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnEntrarActionPerformed(evt);
- }
- });
- btnCerrar.setText("Cerrar");
- btnCerrar.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnCerrarActionPerformed(evt);
- }
- });
- txtPassword.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- txtPasswordActionPerformed(evt);
- }
- });
- txtPassword.addKeyListener(new java.awt.event.KeyAdapter() {
- public void keyReleased(java.awt.event.KeyEvent evt) {
- txtPasswordKeyReleased(evt);
- }
- });
- jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/login.jpg"))); // NOI18N
- javax.swing.GroupLayout DialogoLayout = new javax.swing.GroupLayout(Dialogo.getContentPane());
- Dialogo.getContentPane().setLayout(DialogoLayout);
- DialogoLayout.setHorizontalGroup(
- DialogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(DialogoLayout.createSequentialGroup()
- .addGap(20, 20, 20)
- .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(30, 30, 30)
- .addGroup(DialogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addGroup(DialogoLayout.createSequentialGroup()
- .addGroup(DialogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(DialogoLayout.createSequentialGroup()
- .addGap(20, 20, 20)
- .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGroup(DialogoLayout.createSequentialGroup()
- .addGap(20, 20, 20)
- .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addGap(30, 30, 30))
- .addGroup(DialogoLayout.createSequentialGroup()
- .addComponent(btnCerrar, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
- .addGroup(DialogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(txtUsers, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(btnEntrar, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(48, Short.MAX_VALUE))
- );
- DialogoLayout.setVerticalGroup(
- DialogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(DialogoLayout.createSequentialGroup()
- .addGroup(DialogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(DialogoLayout.createSequentialGroup()
- .addGap(10, 10, 10)
- .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGroup(DialogoLayout.createSequentialGroup()
- .addGap(30, 30, 30)
- .addComponent(jLabel1)
- .addGap(16, 16, 16)
- .addComponent(jLabel2)
- .addGap(26, 26, 26)
- .addGroup(DialogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(btnCerrar)
- .addComponent(btnEntrar)))
- .addGroup(DialogoLayout.createSequentialGroup()
- .addGap(30, 30, 30)
- .addComponent(txtUsers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(10, 10, 10)
- .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addContainerGap(23, Short.MAX_VALUE))
- );
- jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cielo.jpg"))); // NOI18N
- jLabel4.setText("jLabel4");
- javax.swing.GroupLayout DialogoSplashLayout = new javax.swing.GroupLayout(DialogoSplash.getContentPane());
- DialogoSplash.getContentPane().setLayout(DialogoSplashLayout);
- DialogoSplashLayout.setHorizontalGroup(
- DialogoSplashLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(DialogoSplashLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(186, Short.MAX_VALUE))
- );
- DialogoSplashLayout.setVerticalGroup(
- DialogoSplashLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(DialogoSplashLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(105, Short.MAX_VALUE))
- );
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- setTitle("Consultorio Virtual");
- setBackground(new java.awt.Color(51, 51, 255));
- setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
- setForeground(new java.awt.Color(204, 204, 255));
- setMinimumSize(new java.awt.Dimension(640, 350));
- setResizable(false);
- getContentPane().setLayout(null);
- PanelPrincipal.setBackground(new java.awt.Color(255, 255, 255));
- PanelPrincipal.setMaximumSize(new java.awt.Dimension(0, 0));
- PanelPrincipal.setMinimumSize(new java.awt.Dimension(0, 0));
- PanelPrincipal.setLayout(null);
- btnPrincipalPacientes.setBackground(new java.awt.Color(204, 204, 255));
- btnPrincipalPacientes.setFont(new java.awt.Font("Sylfaen", 1, 24));
- btnPrincipalPacientes.setText("Pacientes");
- btnPrincipalPacientes.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- btnPrincipalPacientes.setBorderPainted(false);
- btnPrincipalPacientes.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
- btnPrincipalPacientes.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnPrincipalPacientes.setMargin(new java.awt.Insets(1, 1, 1, 1));
- btnPrincipalPacientes.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseExited(java.awt.event.MouseEvent evt) {
- btnPrincipalPacientesMouseExited(evt);
- }
- });
- btnPrincipalPacientes.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
- public void mouseMoved(java.awt.event.MouseEvent evt) {
- btnPrincipalPacientesMouseMoved(evt);
- }
- });
- btnPrincipalPacientes.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnPrincipalPacientesActionPerformed(evt);
- }
- });
- PanelPrincipal.add(btnPrincipalPacientes);
- btnPrincipalPacientes.setBounds(10, 0, 180, 70);
- btnPrincipalContabilidad.setBackground(new java.awt.Color(204, 204, 255));
- btnPrincipalContabilidad.setFont(new java.awt.Font("Sylfaen", 1, 24));
- btnPrincipalContabilidad.setText("Contabilidad");
- btnPrincipalContabilidad.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- btnPrincipalContabilidad.setBorderPainted(false);
- btnPrincipalContabilidad.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
- btnPrincipalContabilidad.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnPrincipalContabilidad.setMargin(new java.awt.Insets(1, 1, 1, 1));
- btnPrincipalContabilidad.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseExited(java.awt.event.MouseEvent evt) {
- btnPrincipalContabilidadMouseExited(evt);
- }
- });
- btnPrincipalContabilidad.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
- public void mouseMoved(java.awt.event.MouseEvent evt) {
- btnPrincipalContabilidadMouseMoved(evt);
- }
- });
- btnPrincipalContabilidad.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnPrincipalContabilidadActionPerformed(evt);
- }
- });
- PanelPrincipal.add(btnPrincipalContabilidad);
- btnPrincipalContabilidad.setBounds(190, 0, 180, 70);
- btnPrincipalAgenda.setBackground(new java.awt.Color(204, 204, 255));
- btnPrincipalAgenda.setFont(new java.awt.Font("Sylfaen", 1, 24));
- btnPrincipalAgenda.setText("Agenda");
- btnPrincipalAgenda.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- btnPrincipalAgenda.setBorderPainted(false);
- btnPrincipalAgenda.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
- btnPrincipalAgenda.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnPrincipalAgenda.setMargin(new java.awt.Insets(1, 1, 1, 1));
- btnPrincipalAgenda.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseExited(java.awt.event.MouseEvent evt) {
- btnPrincipalAgendaMouseExited(evt);
- }
- });
- btnPrincipalAgenda.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
- public void mouseMoved(java.awt.event.MouseEvent evt) {
- btnPrincipalAgendaMouseMoved(evt);
- }
- });
- btnPrincipalAgenda.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnPrincipalAgendaActionPerformed(evt);
- }
- });
- PanelPrincipal.add(btnPrincipalAgenda);
- btnPrincipalAgenda.setBounds(370, 0, 180, 70);
- btnPrincipalUsuario.setBackground(new java.awt.Color(204, 204, 255));
- btnPrincipalUsuario.setFont(new java.awt.Font("Sylfaen", 1, 24));
- btnPrincipalUsuario.setText("Usuarios");
- btnPrincipalUsuario.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- btnPrincipalUsuario.setBorderPainted(false);
- btnPrincipalUsuario.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
- btnPrincipalUsuario.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnPrincipalUsuario.setMargin(new java.awt.Insets(1, 1, 1, 1));
- btnPrincipalUsuario.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseExited(java.awt.event.MouseEvent evt) {
- btnPrincipalUsuarioMouseExited(evt);
- }
- });
- btnPrincipalUsuario.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
- public void mouseMoved(java.awt.event.MouseEvent evt) {
- btnPrincipalUsuarioMouseMoved(evt);
- }
- });
- btnPrincipalUsuario.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnPrincipalUsuarioActionPerformed(evt);
- }
- });
- PanelPrincipal.add(btnPrincipalUsuario);
- btnPrincipalUsuario.setBounds(370, 70, 180, 70);
- btnPrincipalResumen.setBackground(new java.awt.Color(204, 204, 255));
- btnPrincipalResumen.setFont(new java.awt.Font("Sylfaen", 1, 24));
- btnPrincipalResumen.setText("Resumen");
- btnPrincipalResumen.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- btnPrincipalResumen.setBorderPainted(false);
- btnPrincipalResumen.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
- btnPrincipalResumen.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnPrincipalResumen.setMargin(new java.awt.Insets(1, 1, 1, 1));
- btnPrincipalResumen.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseExited(java.awt.event.MouseEvent evt) {
- btnPrincipalResumenMouseExited(evt);
- }
- });
- btnPrincipalResumen.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
- public void mouseMoved(java.awt.event.MouseEvent evt) {
- btnPrincipalResumenMouseMoved(evt);
- }
- });
- btnPrincipalResumen.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnPrincipalResumenActionPerformed(evt);
- }
- });
- PanelPrincipal.add(btnPrincipalResumen);
- btnPrincipalResumen.setBounds(190, 70, 180, 70);
- btnPrincipalInformacion.setBackground(new java.awt.Color(204, 204, 255));
- btnPrincipalInformacion.setFont(new java.awt.Font("Sylfaen", 1, 24));
- btnPrincipalInformacion.setText("Informacion");
- btnPrincipalInformacion.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- btnPrincipalInformacion.setBorderPainted(false);
- btnPrincipalInformacion.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
- btnPrincipalInformacion.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnPrincipalInformacion.setMargin(new java.awt.Insets(1, 1, 1, 1));
- btnPrincipalInformacion.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseExited(java.awt.event.MouseEvent evt) {
- btnPrincipalInformacionMouseExited(evt);
- }
- });
- btnPrincipalInformacion.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
- public void mouseMoved(java.awt.event.MouseEvent evt) {
- btnPrincipalInformacionMouseMoved(evt);
- }
- });
- btnPrincipalInformacion.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnPrincipalInformacionActionPerformed(evt);
- }
- });
- PanelPrincipal.add(btnPrincipalInformacion);
- btnPrincipalInformacion.setBounds(10, 70, 180, 70);
- btnPrincipalHerramientas.setBackground(new java.awt.Color(204, 204, 255));
- btnPrincipalHerramientas.setFont(new java.awt.Font("Sylfaen", 1, 24));
- btnPrincipalHerramientas.setText("Herramientas");
- btnPrincipalHerramientas.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- btnPrincipalHerramientas.setBorderPainted(false);
- btnPrincipalHerramientas.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
- btnPrincipalHerramientas.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnPrincipalHerramientas.setMargin(new java.awt.Insets(1, 1, 1, 1));
- btnPrincipalHerramientas.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseExited(java.awt.event.MouseEvent evt) {
- btnPrincipalAjustesMouseExited(evt);
- }
- public void mousePressed(java.awt.event.MouseEvent evt) {
- btnPrincipalHerramientasMousePressed(evt);
- }
- });
- btnPrincipalHerramientas.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
- public void mouseMoved(java.awt.event.MouseEvent evt) {
- btnPrincipalHerramientasMouseMoved(evt);
- }
- });
- btnPrincipalHerramientas.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnPrincipalHerramientasActionPerformed(evt);
- }
- });
- PanelPrincipal.add(btnPrincipalHerramientas);
- btnPrincipalHerramientas.setBounds(10, 140, 180, 70);
- btnPrincipalAyuda.setBackground(new java.awt.Color(204, 204, 255));
- btnPrincipalAyuda.setFont(new java.awt.Font("Sylfaen", 1, 24));
- btnPrincipalAyuda.setText("Ayuda");
- btnPrincipalAyuda.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- btnPrincipalAyuda.setBorderPainted(false);
- btnPrincipalAyuda.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
- btnPrincipalAyuda.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnPrincipalAyuda.setMargin(new java.awt.Insets(1, 1, 1, 1));
- btnPrincipalAyuda.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseExited(java.awt.event.MouseEvent evt) {
- btnPrincipalAyudaMouseExited(evt);
- }
- public void mousePressed(java.awt.event.MouseEvent evt) {
- btnPrincipalAyudaMousePressed(evt);
- }
- });
- btnPrincipalAyuda.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
- public void mouseMoved(java.awt.event.MouseEvent evt) {
- btnPrincipalAyudaMouseMoved(evt);
- }
- });
- btnPrincipalAyuda.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnPrincipalAyudaActionPerformed(evt);
- }
- });
- PanelPrincipal.add(btnPrincipalAyuda);
- btnPrincipalAyuda.setBounds(370, 140, 180, 70);
- lblInformacion.setBackground(new java.awt.Color(0, 0, 0));
- lblInformacion.setFont(new java.awt.Font("Sylfaen", 0, 14));
- lblInformacion.setForeground(new java.awt.Color(0, 0, 255));
- lblInformacion.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
- lblInformacion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
- PanelPrincipal.add(lblInformacion);
- lblInformacion.setBounds(10, 220, 540, 50);
- btnPrincipalAjustes.setBackground(new java.awt.Color(204, 204, 255));
- btnPrincipalAjustes.setFont(new java.awt.Font("Sylfaen", 1, 24));
- btnPrincipalAjustes.setText("Ajustes");
- btnPrincipalAjustes.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- btnPrincipalAjustes.setBorderPainted(false);
- btnPrincipalAjustes.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
- btnPrincipalAjustes.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnPrincipalAjustes.setMargin(new java.awt.Insets(1, 1, 1, 1));
- btnPrincipalAjustes.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseExited(java.awt.event.MouseEvent evt) {
- btnPrincipalAjustesMouseExited1(evt);
- }
- public void mousePressed(java.awt.event.MouseEvent evt) {
- btnPrincipalAjustesMousePressed(evt);
- }
- });
- btnPrincipalAjustes.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
- public void mouseMoved(java.awt.event.MouseEvent evt) {
- btnPrincipalAjustesMouseMoved(evt);
- }
- });
- btnPrincipalAjustes.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnPrincipalAjustesActionPerformed(evt);
- }
- });
- PanelPrincipal.add(btnPrincipalAjustes);
- btnPrincipalAjustes.setBounds(190, 140, 180, 70);
- getContentPane().add(PanelPrincipal);
- PanelPrincipal.setBounds(30, 20, 560, 280);
- pack();
- }// </editor-fold>
- private void DialogoWindowClosing(java.awt.event.WindowEvent evt) {
- // TODO add your handling code here:
- System.exit(0);
- }
- private void btnEntrarActionPerformed(java.awt.event.ActionEvent evt) {
- String user = txtUsers.getText();
- String password = txtPassword.getText();
- if(user.isEmpty() || password.isEmpty())
- {
- JOptionPane.showMessageDialog(null, "Ingrese su nombre de usuario y su contraseña");
- }else{
- Conexion conexion = new Conexion();
- try{
- int id_user =0;
- Statement statement = conexion.conectar();
- ResultSet resultset = statement.executeQuery("SELECT * FROM users WHERE user_name ='"+ user + "' AND user_password ='" + password + "'");
- resultset.last();
- int encontrado = resultset.getRow();
- System.out.print(String.valueOf(encontrado));
- if(encontrado ==1)
- {
- this.setVisible(true);
- Dialogo.setVisible(false);
- }else{
- JOptionPane.showMessageDialog(null, "Sus datos son incorrecto. Revise por favor");
- }
- resultset.close();
- statement.close();
- }
- catch(SQLException ex){
- Logger.getLogger(Principal.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
- private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- System.exit(0);
- }
- private void txtPasswordActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- private void txtPasswordKeyReleased(java.awt.event.KeyEvent evt) {
- // TODO add your handling code here:
- if(evt.getKeyCode() == 10){
- System.out.print("Enter");
- this.btnEntrarActionPerformed(null);
- }
- }
- private void btnPrincipalPacientesActionPerformed(java.awt.event.ActionEvent evt) {
- new Pacientes().setVisible(true);
- }
- private void btnPrincipalResumenActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- new Visualizar().setVisible(true);
- }
- private void btnPrincipalInformacionActionPerformed(java.awt.event.ActionEvent evt) {
- try {
- new InfMedico().setVisible(true);
- } catch (SQLException ex) {
- Logger.getLogger(Principal.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- private void btnPrincipalContabilidadActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- new ContabilidadGeneral().setVisible(true);
- }
- private void btnPrincipalPacientesMouseMoved(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- lblInformacion.setText("Informacion del Paciente");
- btnPrincipalPacientes.setForeground(Color.blue);
- btnPrincipalPacientes.setBackground(Color.white);
- }
- private void btnPrincipalContabilidadMouseMoved(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- lblInformacion.setText("LLevar a cabo la contabilidad");
- btnPrincipalContabilidad.setForeground(Color.blue);
- btnPrincipalContabilidad.setBackground(Color.white);
- }
- private void btnPrincipalAgendaActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- new Agenda().setVisible(true);
- }
- private void btnPrincipalAgendaMouseMoved(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- lblInformacion.setText("Agenda Programada del Medico");
- btnPrincipalAgenda.setForeground(Color.blue);
- btnPrincipalAgenda.setBackground(Color.white);
- }
- private void btnPrincipalInformacionMouseMoved(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- lblInformacion.setText("Informacion relativa a los medicos.");
- btnPrincipalInformacion.setForeground(Color.blue);
- btnPrincipalInformacion.setBackground(Color.white);
- }
- private void btnPrincipalResumenMouseMoved(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- lblInformacion.setText("Resumen General");
- btnPrincipalResumen.setForeground(Color.blue);
- btnPrincipalResumen.setBackground(Color.white);
- }
- private void btnPrincipalUsuarioMouseMoved(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- lblInformacion.setText("Mantenimiento de usuarios del sistema");
- btnPrincipalUsuario.setForeground(Color.blue);
- btnPrincipalUsuario.setBackground(Color.white);
- }
- private void btnPrincipalHerramientasMousePressed(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- }
- private void btnPrincipalAyudaMousePressed(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- }
- private void btnPrincipalHerramientasMouseMoved(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- lblInformacion.setText("Herramientas varias, calculadora etc.");
- btnPrincipalHerramientas.setForeground(Color.blue);
- btnPrincipalHerramientas.setBackground(Color.white);
- }
- private void btnPrincipalAyudaMouseMoved(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- lblInformacion.setText("Documentacion y Ayuda del Sistema.");
- btnPrincipalAyuda.setBackground(Color.white);
- btnPrincipalAyuda.setForeground(Color.blue);
- }
- private void btnPrincipalAyudaMouseExited(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- btnPrincipalAyuda.setBackground(new java.awt.Color(204, 204, 255));
- btnPrincipalAyuda.setForeground(Color.black);
- }
- private void btnPrincipalPacientesMouseExited(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- btnPrincipalPacientes.setForeground(Color.black);
- btnPrincipalPacientes.setBackground(new java.awt.Color(204, 204, 255));
- }
- private void btnPrincipalContabilidadMouseExited(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- btnPrincipalContabilidad.setForeground(Color.black);
- btnPrincipalContabilidad.setBackground(new java.awt.Color(204, 204, 255));
- }
- private void btnPrincipalAgendaMouseExited(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- btnPrincipalAgenda.setForeground(Color.black);
- btnPrincipalAgenda.setBackground(new java.awt.Color(204, 204, 255));
- }
- private void btnPrincipalInformacionMouseExited(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- btnPrincipalInformacion.setForeground(Color.black);
- btnPrincipalInformacion.setBackground(new java.awt.Color(204, 204, 255));
- }
- private void btnPrincipalResumenMouseExited(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- btnPrincipalResumen.setForeground(Color.black);
- btnPrincipalResumen.setBackground(new java.awt.Color(204, 204, 255));
- }
- private void btnPrincipalUsuarioMouseExited(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- btnPrincipalUsuario.setForeground(Color.black);
- btnPrincipalUsuario.setBackground(new java.awt.Color(204, 204, 255));
- }
- private void btnPrincipalAjustesMouseExited(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- btnPrincipalHerramientas.setForeground(Color.black);
- btnPrincipalHerramientas.setBackground(new java.awt.Color(204, 204, 255));
- }
- private void btnPrincipalAjustesMouseExited1(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- btnPrincipalAjustes.setForeground(Color.black);
- btnPrincipalAjustes.setBackground(new java.awt.Color(204, 204, 255));
- }
- private void btnPrincipalAjustesMousePressed(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- }
- private void btnPrincipalAjustesMouseMoved(java.awt.event.MouseEvent evt) {
- // TODO add your handling code here:
- lblInformacion.setText("Ajustes generales del Sistema.");
- btnPrincipalAjustes.setForeground(Color.blue);
- btnPrincipalAjustes.setBackground(Color.white);
- }
- private void txtUsersActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- private void btnPrincipalUsuarioActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- new Usuarios().setVisible(true);
- }
- private void btnPrincipalHerramientasActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- new Herramientas().setVisible(true);
- }
- private void btnPrincipalAjustesActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- new Ajustes().setVisible(true);
- }
- private void btnPrincipalAyudaActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- new Ayuda().setVisible(true);
- }
- /**
- * @param args the command line arguments
- */
- public static void main(String args[]) {
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new Principal().setLocationRelativeTo(null);
- }
- });
- }
- // Variables declaration - do not modify
- private javax.swing.JDialog Dialogo;
- private javax.swing.JDialog DialogoSplash;
- private javax.swing.JPanel PanelPrincipal;
- private javax.swing.JButton btnCerrar;
- private javax.swing.JButton btnEntrar;
- private javax.swing.JButton btnPrincipalAgenda;
- private javax.swing.JButton btnPrincipalAjustes;
- private javax.swing.JButton btnPrincipalAyuda;
- private javax.swing.JButton btnPrincipalContabilidad;
- private javax.swing.JButton btnPrincipalHerramientas;
- private javax.swing.JButton btnPrincipalInformacion;
- private javax.swing.JButton btnPrincipalPacientes;
- private javax.swing.JButton btnPrincipalResumen;
- private javax.swing.JButton btnPrincipalUsuario;
- private javax.swing.JLabel jLabel1;
- private javax.swing.JLabel jLabel2;
- private javax.swing.JLabel jLabel3;
- private javax.swing.JLabel jLabel4;
- private javax.swing.JLabel lblInformacion;
- private javax.swing.JPasswordField txtPassword;
- private javax.swing.JTextField txtUsers;
- // End of variables declaration
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement