Você está na página 1de 9

My favorites | Sign in proyectoregistrocic Proyecto simulacin Project Home Downloads Wiki Issues Source Checkout Browse Changes Source

e path: svn/ trunk/ SimulacionRegistroCIC/ src/ simulacion/ ui/ VentanaAcceso.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

r5

r1 2

/* * VentanaAcceso.java * * Created on 14/04/2010, 12:59:30 AM */ package simulacion.ui; import java.awt.Dimension; import java.awt.Toolkit; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JDialog; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; /** * * @author Freddy */ public class VentanaAcceso extends javax.swing.JFrame { /** * Contructor de la clase por defecto */ public VentanaAcceso() { initComponents(); Dimension pantalla = Toolkit.getDefaultToolkit().getScreenSize(); Dimension ventana = getSize(); setLocation((pantalla.width - ventana.width) / 2,(pantalla.height ventana.height) / 2); }

36 37 /** 38 * Inicializa los componentes 39 */ 40 private void initComponents() {//GEN-BEGIN:initComponents 41 42 jToolBar1 = new javax.swing.JToolBar(); 43 jButton1 = new javax.swing.JButton(); 44 jPanel1 = new javax.swing.JPanel(); 45 jPanel2 = new javax.swing.JPanel(); 46 jLabel1 = new javax.swing.JLabel(); 47 jTextField1 = new javax.swing.JTextField(); 48 jButton2 = new javax.swing.JButton(); 49 jXStatusBar1 = new org.jdesktop.swingx.JXStatusBar(); 50 statusJLabel = new javax.swing.JLabel(); 51 jMenuBar1 = new javax.swing.JMenuBar(); 52 jMenu1 = new javax.swing.JMenu(); 53 jMenu2 = new javax.swing.JMenu(); 54 55 56 setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Prestamo equipos del CIC"); 57 setLocationByPlatform(true); 58 59 jToolBar1.setRollover(true); 60 61 jButton1.setIcon(new 62 63 javax.swing.ImageIcon(getClass().getResource("/simulacion/ui/resource/registro.pn 64 g"))); // NOI18N jButton1.setText("Registrar"); 65 jButton1.setToolTipText("Registrar a un nuevo usuario"); 66 jButton1.setFocusable(false); 67 jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); 68 jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); 69 jButton1.addActionListener(new java.awt.event.ActionListener() { 70 public void actionPerformed(java.awt.event.ActionEvent evt) { 71 jButton1ActionPerformed(evt); 72 } 73 }); 74 jToolBar1.add(jButton1); 75 76 jPanel1.setBackground(new java.awt.Color(0, 102, 153)); 77 78 jPanel2.setBackground(new java.awt.Color(255, 255, 255)); 79 80

81 jLabel1.setText("Matricula:"); 82 83 jButton2.setText("Usar equipo"); 84 jButton2.addActionListener(new java.awt.event.ActionListener() { 85 public void actionPerformed(java.awt.event.ActionEvent evt) { 86 validarMatricula(evt); 87 } 88 }); 89 90 javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); 91 jPanel2.setLayout(jPanel2Layout); 92 jPanel2Layout.setHorizontalGroup( 93 94 95 jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN 96 G) .addGroup(jPanel2Layout.createSequentialGroup() 97 .addGap(48, 48, 48) 98 99 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignme 10 nt.LEADING) 0 .addComponent(jButton2) 10 .addGroup(jPanel2Layout.createSequentialGroup() 1 .addComponent(jLabel1) 10 2 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 10 .addComponent(jTextField1, 3 javax.swing.GroupLayout.PREFERRED_SIZE, 126, 10 javax.swing.GroupLayout.PREFERRED_SIZE))) 4 .addContainerGap(188, Short.MAX_VALUE)) 10 ); 5 jPanel2Layout.setVerticalGroup( 10 6 jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN 10 G) 7 .addGroup(jPanel2Layout.createSequentialGroup() 10 .addGap(105, 105, 105) 8 10 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignme 9 nt.BASELINE) 11 .addComponent(jLabel1) 0 .addComponent(jTextField1, 11 javax.swing.GroupLayout.PREFERRED_SIZE, 1 javax.swing.GroupLayout.DEFAULT_SIZE, 11 javax.swing.GroupLayout.PREFERRED_SIZE)) 2 .addGap(31, 31, 31) 11 .addComponent(jButton2)

3 11 4 11 5 11 6 11 7 11 8 11 9 12 0 12 1 12 2 12 3 12 4 12 5 12 6 12 7 12 8 12 9 13 0 13 1 13 2 13 3 13 4 13 5 13 6

.addContainerGap(76, Short.MAX_VALUE)) ); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN G) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(28, 28, 28) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(33, 33, 33)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN G) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); javax.swing.GroupLayout jXStatusBar1Layout = new javax.swing.GroupLayout(jXStatusBar1); jXStatusBar1.setLayout(jXStatusBar1Layout); jXStatusBar1Layout.setHorizontalGroup( jXStatusBar1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE ADING) .addGroup(jXStatusBar1Layout.createSequentialGroup() .addComponent(statusJLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(195, Short.MAX_VALUE)) ); jXStatusBar1Layout.setVerticalGroup( jXStatusBar1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE ADING) .addComponent(statusJLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 11, Short.MAX_VALUE) ); jMenu1.setText("File"); jMenuBar1.add(jMenu1);

13 7 13 8 13 9 14 0 14 1 14 2 14 3 14 4 14 5 14 6 14 7 14 8 14 9 15 0 15 1 15 2 15 3 15 4 15 5 15 6 15 7 15 8 15 9 16 0

jMenu2.setText("Edit"); jMenuBar1.add(jMenu2); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jXStatusBar1, 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) .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 480, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jXStatusBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); pack(); }//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_jButton1ActionPerformed JDialog dialog = new JDialog(this); dialog.getContentPane().add(new VentanaAdministrarUsuario());

16 1 16 2 16 3 16 4 16 5 16 6 16 7 16 8 16 9 17 0 17 1 17 2 17 3 17 4 17 5 17 6 17 7 17 8 17 9 18 0 18 1 18 2 18 3 18 4

dialog.setTitle("Registro"); dialog.setLocationByPlatform(true); dialog.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource( "/simulacion/ui/resource/registro.png"))); dialog.setResizable(false); dialog.setModal(true); dialog.setSize(600, 400); dialog.setVisible(true); }//GEN-LAST:event_jButton1ActionPerformed private void validarMatricula(java.awt.event.ActionEvent evt) {//GENFIRST:event_validarMatricula // TODO implementar metodo }//GEN-LAST:event_validarMatricula /** * @param args the command line arguments */ public static void main(String args[]) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAn dFeel");//NOI18N java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new VentanaAcceso().setVisible(true); } }); } catch (ClassNotFoundException ex) { Logger.getLogger(VentanaAcceso.class.getName()).log(Level.SEVERE, null, ex); } catch (InstantiationException ex) { Logger.getLogger(VentanaAcceso.class.getName()).log(Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { Logger.getLogger(VentanaAcceso.class.getName()).log(Level.SEVERE, null, ex); } catch (UnsupportedLookAndFeelException ex) { Logger.getLogger(VentanaAcceso.class.getName()).log(Level.SEVERE, null, ex); } } private static final long serialVersionUID = -1887170220049515514L; // Variables declaration - do not modify//GEN-BEGIN:variables

18 5 18 6 18 7 18 8 18 9 19 0 19 1 19 2 19 3 19 4 19 5 19 6 19 7 19 8 19 9 20 } 0 20 1 20 2 20 3 20 4 20 5 20 6 20 7 20 8

private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JTextField jTextField1; private javax.swing.JToolBar jToolBar1; private org.jdesktop.swingx.JXStatusBar jXStatusBar1; private javax.swing.JLabel statusJLabel; // End of variables declaration//GEN-END:variables

20 9 21 0 21 1 21 2 21 3 21 4 21 5 21 6 21 7 21 8 21 9 22 0 22 1 22 2 Hide details Change log r12 by NeoCsElAngelBlanco on May 28, 2010 Diff
clases ventana

Go to: Project members, sign in to write a code review Older revisions r5 by neocselangelblanco on May 27, 2010 Diff r4 by NeoCsElAngelBlanco on Apr 14, 2010 Diff All revisions of this file File info Size: 10051 bytes, 222 lines View raw file

2011 Google - Terms - Privacy - Project Hosting Help Powered by Google Project Hosting