Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. package interfaz;
  2.  
  3. import java.awt.Color;
  4. import java.awt.FlowLayout;
  5. import java.awt.event.ActionEvent;
  6. import java.awt.event.ActionListener;
  7.  
  8. import javax.swing.ImageIcon;
  9. import javax.swing.JButton;
  10. import javax.swing.JFrame;
  11.  
  12. public class AccesoSistema extends JFrame{
  13.    
  14.     private JButton btNuevoUsuario, btListarUsuarios;
  15.    
  16.    
  17.     public AccesoSistema (){
  18.        
  19.         FlowLayout fl = new FlowLayout();
  20.         this.setTitle("Selecciona una tarea");
  21.        
  22.         this.setLayout(fl);
  23.        
  24.         CrearInterfaz();
  25.        
  26.         Escuchadores();
  27.        
  28.     }
  29.    
  30.     private void CrearInterfaz(){
  31.        
  32.         btNuevoUsuario = new JButton("Nuevo Usuario", new ImageIcon(getClass().getResource("/images/user.png")));
  33.         btListarUsuarios = new JButton("Listar Usuarios", new ImageIcon(getClass().getResource("/images/listar.png")));
  34.         btNuevoUsuario.setOpaque(true);
  35.         btNuevoUsuario.setBackground(null);
  36.         btNuevoUsuario.setForeground(null);
  37.        
  38.        
  39.         this.add(btNuevoUsuario);
  40.         this.add(btListarUsuarios);
  41.        
  42.     }
  43.    
  44.     private void Escuchadores(){
  45.        
  46.        
  47.         btNuevoUsuario.addActionListener(new ActionListener() {
  48.            
  49.             @Override
  50.             public void actionPerformed(ActionEvent arg0) {
  51.                
  52.                 //LLAMAMOS VENTANA PARA NUEVO USUARIO
  53.                
  54.             }
  55.         });
  56.        
  57.         btListarUsuarios.addActionListener(new ActionListener() {
  58.            
  59.             @Override
  60.             public void actionPerformed(ActionEvent e) {
  61.                
  62.                 //LLAMAMOS A VENTANA PARA LISTAR USUARIOS
  63.                
  64.             }
  65.         });
  66.        
  67.     }
  68.  
  69. }