/** * Returns the integer value of the setting for the given key * * @param key key whose associated setting is to be returned. * @return the setting to which this setting maps the specified key, or <code>null</code> if the * map contains no mapping for this key. */ public Integer getIntegerSetting(final String key) { final Object value = getSetting(key); if (value == null) { if (Beans .isDesignTime()) { // in case of design time we return a "0" so that dependent code does // not fail return new Integer(0); } else { return null; } } if (value instanceof Integer) { return (Integer) value; } else { final String strgValue = value.toString(); try { return new Integer(strgValue); } catch (final NumberFormatException e) { if (Beans .isDesignTime()) { // in case of design time we return a "0" so that dependent code does // not fail return Integer.valueOf(0); } else { return null; } } } }
@Override protected ArrayList<Usuario> doInBackground() { ArrayList<Usuario> ret = new ArrayList<Usuario>(); if (!Beans.isDesignTime()) { try { PreparedStatement st = (PreparedStatement) MaimonidesApp.getApplication() .getConector() .getConexion() .prepareStatement( "SELECT * FROM usuarios WHERE fbaja IS NULL ORDER BY nombre"); ResultSet res = st.executeQuery(); while (res.next()) { Usuario p = new Usuario(); try { p.cargarDesdeResultSet(res); ret.add(p); } catch (SQLException ex) { Logger.getLogger(PanelUsuarios.class.getName()).log(Level.SEVERE, null, ex); } catch (Exception ex) { Logger.getLogger(PanelUsuarios.class.getName()).log(Level.SEVERE, null, ex); } } Obj.cerrar(st, res); } catch (SQLException ex) { Logger.getLogger(PanelUsuarios.class.getName()).log(Level.SEVERE, null, ex); } } return ret; // return your result }
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { if (Beans.isDesignTime()) { super.insertString(offs, str, a); return; } if (!validateEntry) { super.insertString(offs, str, a); validateEntry = true; return; } StringBuffer sb = new StringBuffer(getText(0, getLength())); sb.insert(offs, str); if (sb.toString().equals("-")) { super.insertString(offs, str, a); stringValue = null; value = null; } else { String text = sb.toString(); if (text.equals("-.")) sb.insert(1, "0"); else if (text.equals(".")) sb.insert(0, "0"); Number num = decode(sb.toString()); if (num != null) { super.insertString(offs, str, a); if (text.equals("-.") || text.equals(".")) super.insertString(offs, "0", a); stringValue = sb.toString(); value = num; } } }
// <editor-fold defaultstate="collapsed" desc=" initComponents "> private void initComponents() { if (Beans.isDesignTime()) { addTab("Tab 1", new JPanel()); } Font f = ThemeUI.getFont("XTabbedPane.font"); if (f != null) setFont(f); }
public String getText() { if (Beans.isDesignTime()) { if (!ValueUtil.isEmpty(expression)) return expression; else if (!ValueUtil.isEmpty(getName())) return getName(); else return super.getText(); } else { return super.getText(); } }
/** Creates new form BeanForm */ public ZTable() { initComponents(); if (!Beans.isDesignTime()) { try { rowSet = new JdbcRowSetImpl(conn); } catch (Exception e) { e.printStackTrace(); } dataBaru = new Vector(); } }
public OrderTable(ApplicationContext context) { super(); this.context = context; if (!Beans.isDesignTime()) { setModel(new OrderDetailsTableModel()); initTableCellComponents(); setRowSelectionAllowed(false); setColumnSelectionAllowed(false); setCellSelectionEnabled(true); setSortable(false); getTableHeader().setReorderingAllowed(false); getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); // setTableListeners(); } }
/** Creates new form CustomerTab */ public OrderInfoTab() { initComponents(); changeEditable(); readyValue.setDateFormatString("dd.MM.yyyy"); costValue.setMask(regExp); if (!Beans.isDesignTime()) { addPropertyChangeListener( "editable", new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { changeEditable(); } }); } }
/** Creates new form PanelProfesores */ public PanelProfesores() { initComponents(); if (!Beans.isDesignTime()) { MaimonidesUtil.addMenuTabla(tabla, "Listado de Profesores"); tabla.getColumnExt("Código Séneca").setVisible(false); tabla.setDefaultRenderer( GregorianCalendar.class, new DefaultTableCellRenderer() { @Override public void setValue(Object val) { if (val instanceof GregorianCalendar) { setText(Fechas.format((GregorianCalendar) val)); } else { setText(""); } } }); tabla.setDefaultEditor(GregorianCalendar.class, new DateCellEditor()); tabla .getSelectionModel() .addListSelectionListener( new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { int pos = tabla.getSelectedRow(); Profesor p = null; if (pos != -1) { pos = tabla.convertRowIndexToModel(pos); p = modelo.getElemento(pos); setProfesorSeleccionado(p != null); } else { setProfesorSeleccionado(false); } firePropertyChange("profesorAsignado", null, p); } } }); } setHayEnviosWeb(EnviosWeb.hayEnviosWeb()); }
@Override protected Vector<Profesor> doInBackground() { Vector<Profesor> ret = new Vector<Profesor>(); if (!Beans.isDesignTime()) { try { if (Permisos.isUsuarioSoloProfesor() && Permisos.getFiltroProfesor() != null) { ret.add(Permisos.getFiltroProfesor()); } else { PreparedStatement st = (PreparedStatement) MaimonidesApp.getApplication() .getConector() .getConexion() .prepareStatement( "SELECT * FROM profesores_ WHERE ano=? ORDER BY nombre,apellido1,apellido2"); st.setInt(1, MaimonidesApp.getApplication().getAnoEscolar().getId()); ResultSet res = st.executeQuery(); while (res.next()) { Profesor p = new Profesor(); try { p.cargarDesdeResultSet(res); ret.add(p); } catch (SQLException ex) { Logger.getLogger(PanelProfesores.class.getName()).log(Level.SEVERE, null, ex); } catch (Exception ex) { Logger.getLogger(PanelProfesores.class.getName()).log(Level.SEVERE, null, ex); } } Obj.cerrar(st, res); } } catch (SQLException ex) { Logger.getLogger(PanelProfesores.class.getName()).log(Level.SEVERE, null, ex); } } return ret; // return your result }
/** * Get shared instance * * @throws IllegalStateException until config is loaded from disk */ public static Config getInstance() { if (!loaded && !Beans.isDesignTime()) { throw new IllegalStateException("Config not yet loaded!"); } return instance; }
/** * 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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory( "com.javaswingmaven_T08_Database_Access_jar_1.0-SNAPSHOTPU") .createEntityManager(); customerQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT c FROM Customer c"); customers = ObservableCollections.observableList( java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : customerQuery.getResultList()); jScrollPane1 = new javax.swing.JScrollPane(); customersTbl = new javax.swing.JTable(); addBtn = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, customers, customersTbl); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${customerId}")); columnBinding.setColumnName("Customer Id"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${name}")); columnBinding.setColumnName("Name"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${addressline1}")); columnBinding.setColumnName("Addressline1"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${addressline2}")); columnBinding.setColumnName("Addressline2"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${city}")); columnBinding.setColumnName("City"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${state}")); columnBinding.setColumnName("State"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${phone}")); columnBinding.setColumnName("Phone"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${fax}")); columnBinding.setColumnName("Fax"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${email}")); columnBinding.setColumnName("Email"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${creditLimit}")); columnBinding.setColumnName("Credit Limit"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${discountCode}")); columnBinding.setColumnName("Discount Code"); columnBinding.setColumnClass(com.javaswingmaven.models.DiscountCode.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${zip}")); columnBinding.setColumnName("Zip"); columnBinding.setColumnClass(com.javaswingmaven.models.MicroMarket.class); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane1.setViewportView(customersTbl); addBtn.setText("Add"); addBtn.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addBtnActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) .addGroup( layout .createSequentialGroup() .addGap(180, 180, 180) .addComponent(addBtn) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addComponent( jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(addBtn))); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END: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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); tesisUpecPUEntityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("tesisUpecPU") .createEntityManager(); cursoPostgradoQuery = java.beans.Beans.isDesignTime() ? null : tesisUpecPUEntityManager.createQuery("SELECT c FROM CursoPostgrado c"); cursoPostgradoList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( cursoPostgradoQuery.getResultList()); jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jPanel5 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jLabel5 = new javax.swing.JLabel(); jComboBox1 = new javax.swing.JComboBox(); jButton4 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Gestionar Curso Postgrado"); setResizable(false); addWindowListener( new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } }); jPanel1.setBackground(new java.awt.Color(30, 76, 89)); jPanel2.setBackground(new java.awt.Color(30, 76, 89)); jLabel1.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/banergrande.jpg"))); // NOI18N jPanel4.setBackground(new java.awt.Color(255, 255, 255)); jPanel4.setBorder( javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(30, 76, 89))); jLabel3.setIcon( new javax.swing.ImageIcon( getClass().getResource("/imagenes/gestioncursopostgrado.jpg"))); // NOI18N jLabel3.setText("jLabel3"); jLabel2.setText("Tipo de Curso Postgrado:"); jLabel4.setText("Descripción:"); jTextField1.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { jTextField1KeyTyped(evt); } }); jTextArea1.setColumns(20); jTextArea1.setRows(5); jTextArea1.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { jTextArea1KeyTyped(evt); } }); jScrollPane1.setViewportView(jTextArea1); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel4Layout .createSequentialGroup() .addGap(26, 26, 26) .addGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 432, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup( jPanel4Layout .createSequentialGroup() .addGap(10, 10, 10) .addGroup( jPanel4Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jLabel4)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( jPanel4Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jScrollPane1) .addComponent( jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)))) .addContainerGap(72, Short.MAX_VALUE))); jPanel4Layout.setVerticalGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel4Layout .createSequentialGroup() .addContainerGap() .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent( jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel4) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(46, Short.MAX_VALUE))); jPanel5.setBackground(new java.awt.Color(255, 255, 255)); jPanel5.setBorder( javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(30, 76, 89))); jButton1.setText("Insertar"); jButton1.addMouseListener( new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton1MousePressed(evt); } }); jButton2.setText("Modificar"); jButton2.addMouseListener( new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton2MousePressed(evt); } }); jButton3.setText("Eliminar"); jButton3.addMouseListener( new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton3MousePressed(evt); } }); jButton5.setText("Cancelar"); jButton5.addMouseListener( new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton5MousePressed(evt); } }); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel5Layout .createSequentialGroup() .addGap(111, 111, 111) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3) .addGap(18, 18, 18) .addComponent(jButton5) .addContainerGap(99, Short.MAX_VALUE))); jPanel5Layout.setVerticalGroup( jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel5Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton2) .addComponent(jButton1) .addComponent(jButton3) .addComponent(jButton5)) .addContainerGap(13, Short.MAX_VALUE))); jPanel3.setBackground(new java.awt.Color(255, 255, 255)); jPanel3.setBorder( javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(30, 76, 89))); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cursoPostgradoList, jTable1); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${tipoPostgrado}")); columnBinding.setColumnName("Tipo de Postgrado"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${descripcionPostgrado}")); columnBinding.setColumnName("Descripción"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane2.setViewportView(jTable1); jLabel5.setText("Cudorso Postgrado:"); org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cursoPostgradoList, jComboBox1); bindingGroup.addBinding(jComboBoxBinding); jButton4.setText("Buscar"); jButton4.addMouseListener( new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton4MousePressed(evt); } }); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addContainerGap() .addComponent(jLabel5) .addGap(18, 18, 18) .addComponent( jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(51, 51, 51) .addComponent(jButton4) .addContainerGap(103, Short.MAX_VALUE)) .addComponent( jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE)); jPanel3Layout.setVerticalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addGap(20, 20, 20) .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent( jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton4)) .addGap(18, 18, 18) .addComponent( jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE))); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)); jPanel2Layout.setVerticalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); jPanel1Layout.setVerticalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .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, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 629, javax.swing.GroupLayout.PREFERRED_SIZE)); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END: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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("celciusPU") .createEntityManager(); query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT b FROM Bolsters b"); list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( query.getResultList()); masterScrollPane = new javax.swing.JScrollPane(); masterTable = new javax.swing.JTable(); rangeLabel = new javax.swing.JLabel(); sizeLabel = new javax.swing.JLabel(); smvLabel = new javax.swing.JLabel(); rangeField = new javax.swing.JTextField(); sizeField = new javax.swing.JTextField(); smvField = new javax.swing.JTextField(); saveButton = new javax.swing.JButton(); refreshButton = new javax.swing.JButton(); newButton = new javax.swing.JButton(); deleteButton = new javax.swing.JButton(); jComboBox1 = new javax.swing.JComboBox(); FormListener formListener = new FormListener(); setBackground(new java.awt.Color(204, 204, 204)); setMinimumSize(new java.awt.Dimension(400, 400)); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, list, masterTable); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${range}")); columnBinding.setColumnName("Range"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${size}")); columnBinding.setColumnName("Size ( diameter X length )"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${smv}")); columnBinding.setColumnName("Smv"); columnBinding.setColumnClass(Double.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); masterScrollPane.setViewportView(masterTable); rangeLabel.setText("Range:"); sizeLabel.setText("Size:"); smvLabel.setText("Smv:"); org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.range}"), rangeField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), rangeField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.size}"), sizeField, org.jdesktop.beansbinding.BeanProperty.create("text_ON_ACTION_OR_FOCUS_LOST")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), sizeField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.smv}"), smvField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), smvField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); saveButton.setText("Save"); saveButton.addActionListener(formListener); refreshButton.setText("Refresh"); refreshButton.addActionListener(formListener); newButton.setText("New"); newButton.addActionListener(formListener); deleteButton.setText("Delete"); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), deleteButton, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); deleteButton.addActionListener(formListener); jComboBox1.setModel( new javax.swing.DefaultComboBoxModel(new String[] {"", "Classic", "Super", "Other"})); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, rangeField, org.jdesktop.beansbinding.ELProperty.create("${text}"), jComboBox1, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addComponent(newButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(deleteButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(refreshButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(saveButton)) .addGroup( layout .createSequentialGroup() .addContainerGap() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(rangeLabel) .addComponent(sizeLabel) .addComponent(smvLabel)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( sizeField, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE) .addComponent( smvField, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addComponent( jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement .RELATED, 28, Short.MAX_VALUE) .addComponent( rangeField, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGroup( layout .createSequentialGroup() .addContainerGap() .addComponent( masterScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE))) .addContainerGap())); layout.linkSize( javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {deleteButton, newButton, refreshButton, saveButton}); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addComponent( masterScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rangeLabel) .addComponent( rangeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(sizeLabel) .addComponent( sizeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(smvLabel) .addComponent( smvField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(saveButton) .addComponent(refreshButton) .addComponent(deleteButton) .addComponent(newButton)) .addContainerGap())); rangeField.setVisible(false); bindingGroup.bind(); }
/** * 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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); myTableRenderer1 = new misc.MyTableRenderer(); playList2 = playList1; songQuery = em.createQuery("SELECT pls.songid FROM PlayListSong pls WHERE pls.playlistid=:playlist") .setParameter("playlist", playList2); songList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( songQuery.getResultList()); songList.add(new Song(-1L)); playListSongQuery = em.createQuery("SELECT pls FROM PlayListSong pls WHERE pls.playlistid=:playlist") .setParameter("playlist", playList2); playListSongList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( playListSongQuery.getResultList()); albumSongQuery = albumSongQuery = em.createQuery( "SELECT albsong FROM AlbumSong albsong WHERE albsong.songid IN :songlist") .setParameter("songlist", songList); albumSongList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( albumSongQuery.getResultList()); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel10 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); newButton = new javax.swing.JButton(); deleteButton = new javax.swing.JButton(); saveButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); jLabel4 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); myTableRenderer1.setText("myTableRenderer2"); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Διαχείριση Λίστας"); jLabel2.setText("Περιγραφή:"); org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, playList2, org.jdesktop.beansbinding.ELProperty.create("${name}"), jTextField1, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jTextField1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); jLabel10.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel10.setText("Λίστα Τραγουδιών"); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, albumSongList, jTable1); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${songid.title}")); columnBinding.setColumnName("Τίτλος"); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${albumid}")); columnBinding.setColumnName("Καλλιτέχνης / Συγκρότημα"); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${songid.duration}")); columnBinding.setColumnName("Διάρκεια"); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane1.setViewportView(jTable1); if (jTable1.getColumnModel().getColumnCount() > 0) { jTable1.getColumnModel().getColumn(1).setCellRenderer(myTableRenderer1); } newButton.setText("Εισαγωγή τραγουδιού"); newButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { newButtonActionPerformed(evt); } }); deleteButton.setText("Διαγραφή τραγουδιού"); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), deleteButton, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); deleteButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deleteButtonActionPerformed(evt); } }); saveButton.setText("Αποθήκευση"); saveButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveButtonActionPerformed(evt); } }); cancelButton.setText("Ακύρωση"); cancelButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelButtonActionPerformed(evt); } }); jLabel4.setText("Ημερομηνία δημιουργίας:"); jTextField2.setFocusable(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, playList2, org.jdesktop.beansbinding.ELProperty.create("${creationdate}"), jTextField2, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jTextField2.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField2ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup( layout .createSequentialGroup() .addContainerGap() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addComponent(saveButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement .RELATED) .addComponent(cancelButton)) .addGroup( layout .createSequentialGroup() .addComponent(newButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement .RELATED) .addComponent(deleteButton)) .addGroup( layout .createSequentialGroup() .addComponent(jLabel4) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement .RELATED) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment .LEADING) .addComponent( jTextField2, javax.swing.GroupLayout .PREFERRED_SIZE, 100, javax.swing.GroupLayout .PREFERRED_SIZE) .addComponent( jTextField1, javax.swing.GroupLayout .PREFERRED_SIZE, 268, javax.swing.GroupLayout .PREFERRED_SIZE)))) .addGap(0, 0, Short.MAX_VALUE)) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addComponent(jLabel2) .addGap(0, 539, Short.MAX_VALUE)) .addComponent(jScrollPane1)) .addContainerGap())))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addContainerGap() .addComponent( jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent( jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent( jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(jLabel10) .addGap(18, 18, 18) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(newButton) .addComponent(deleteButton)) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(saveButton) .addComponent(cancelButton)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); bindingGroup.bind(); pack(); setLocationRelativeTo(null); } // </editor-fold>//GEN-END:initComponents
public BolsterView() { initComponents(); if (!Beans.isDesignTime()) { entityManager.getTransaction().begin(); } }
/** * 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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); JollydaysBuchhaltungPUJollydaysEntityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory( "JollydaysBuchhaltungPUJollydays") .createEntityManager(); buhaAreaQuery = java.beans.Beans.isDesignTime() ? null : JollydaysBuchhaltungPUJollydaysEntityManager.createQuery("SELECT b FROM BuhaArea b"); buhaAreaList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : buhaAreaQuery.getResultList(); buhaAreaQuery1 = java.beans.Beans.isDesignTime() ? null : JollydaysBuchhaltungPUJollydaysEntityManager.createQuery("SELECT b FROM BuhaArea b"); buhaAreaList1 = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : buhaAreaQuery1.getResultList(); buhaBookingQuery = java.beans.Beans.isDesignTime() ? null : JollydaysBuchhaltungPUJollydaysEntityManager.createQuery( "SELECT b FROM BuhaBooking b"); buhaBookingList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : buhaBookingQuery.getResultList(); buhaFilterQuery = java.beans.Beans.isDesignTime() ? null : JollydaysBuchhaltungPUJollydaysEntityManager.createQuery( "SELECT b FROM BuhaFilter b"); buhaFilterList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : buhaFilterQuery.getResultList(); jScrollPane2 = new javax.swing.JScrollPane(); jTableArea = new javax.swing.JTable(); jScrollPane1 = new javax.swing.JScrollPane(); jTableBooking = new javax.swing.JTable(); jButtonDelArea = new javax.swing.JButton(); jButtonNewArea = new javax.swing.JButton(); jButtonSaveBooking = new javax.swing.JButton(); jButtonRefreshBooking = new javax.swing.JButton(); jButtonDelBooking = new javax.swing.JButton(); jButtonNewBooking = new javax.swing.JButton(); jScrollPane3 = new javax.swing.JScrollPane(); jTableFilter = new javax.swing.JTable(); jButtonSaveFilter = new javax.swing.JButton(); jButtonRefreshFilter = new javax.swing.JButton(); jButtonDelFilter = new javax.swing.JButton(); jButtonNewFilter = new javax.swing.JButton(); setName("Form"); // NOI18N jScrollPane2.setName("jScrollPane2"); // NOI18N jTableArea.setName("jTableArea"); // NOI18N org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, buhaAreaList, jTableArea); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${description}")); columnBinding.setColumnName("Description"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}")); columnBinding.setColumnName("Id"); columnBinding.setColumnClass(Integer.class); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane2.setViewportView(jTableArea); jScrollPane1.setName("jScrollPane1"); // NOI18N jTableBooking.setName("jTableBooking"); // NOI18N jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, buhaBookingList, jTableBooking); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${kontosoll}")); columnBinding.setColumnName("Konto Soll"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${kontohaben}")); columnBinding.setColumnName("Kontohaben"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${debitor}")); columnBinding.setColumnName("Debitor"); columnBinding.setColumnClass(Short.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${creditor}")); columnBinding.setColumnName("Creditor"); columnBinding.setColumnClass(Short.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${buchungscode}")); columnBinding.setColumnName("Buchungscode"); columnBinding.setColumnClass(Short.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${steuersatz}")); columnBinding.setColumnName("Steuersatz"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${gutscheinfilter}")); columnBinding.setColumnName("Gutscheinfilter"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${bookingtype}")); columnBinding.setColumnName("Bookingtype"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${buhaCountry}")); columnBinding.setColumnName("Buha Country"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${webCountry}")); columnBinding.setColumnName("Web Country"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${description}")); columnBinding.setColumnName("Description"); columnBinding.setColumnClass(String.class); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane1.setViewportView(jTableBooking); org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(at.jollydays.booking.ui.MainUI.class) .getContext() .getResourceMap(JPanelKonfigER.class); jTableBooking .getColumnModel() .getColumn(1) .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title1")); // NOI18N jTableBooking .getColumnModel() .getColumn(2) .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title2")); // NOI18N jTableBooking .getColumnModel() .getColumn(3) .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title3")); // NOI18N jTableBooking .getColumnModel() .getColumn(4) .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title4")); // NOI18N jTableBooking .getColumnModel() .getColumn(5) .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title5")); // NOI18N jTableBooking .getColumnModel() .getColumn(6) .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title6")); // NOI18N jTableBooking .getColumnModel() .getColumn(7) .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title7")); // NOI18N jTableBooking .getColumnModel() .getColumn(8) .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title8")); // NOI18N jTableBooking .getColumnModel() .getColumn(9) .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title9")); // NOI18N jTableBooking .getColumnModel() .getColumn(10) .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title10")); // NOI18N javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(at.jollydays.booking.ui.MainUI.class) .getContext() .getActionMap(JPanelKonfigER.class, this); jButtonDelArea.setAction(actionMap.get("deleteAreaRecord")); // NOI18N jButtonDelArea.setText(resourceMap.getString("jButtonDelArea.text")); // NOI18N jButtonDelArea.setName("jButtonDelArea"); // NOI18N jButtonNewArea.setAction(actionMap.get("newAreaRecord")); // NOI18N jButtonNewArea.setText(resourceMap.getString("jButtonNewArea.text")); // NOI18N jButtonNewArea.setName("jButtonNewArea"); // NOI18N jButtonSaveBooking.setText(resourceMap.getString("jButtonSaveBooking.text")); // NOI18N jButtonSaveBooking.setName("jButtonSaveBooking"); // NOI18N jButtonRefreshBooking.setText(resourceMap.getString("jButtonRefreshBooking.text")); // NOI18N jButtonRefreshBooking.setName("jButtonRefreshBooking"); // NOI18N jButtonDelBooking.setText(resourceMap.getString("jButtonDelBooking.text")); // NOI18N jButtonDelBooking.setName("jButtonDelBooking"); // NOI18N jButtonNewBooking.setText(resourceMap.getString("jButtonNewBooking.text")); // NOI18N jButtonNewBooking.setName("jButtonNewBooking"); // NOI18N jScrollPane3.setName("jScrollPane3"); // NOI18N jTableFilter.setName("jTableFilter"); // NOI18N jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, buhaFilterList, jTableFilter); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${itemFrom}")); columnBinding.setColumnName("Item From"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${itemTo}")); columnBinding.setColumnName("Item To"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${gutscheinfilter}")); columnBinding.setColumnName("Gutscheinfilter"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${country}")); columnBinding.setColumnName("Country"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${description}")); columnBinding.setColumnName("Description"); columnBinding.setColumnClass(String.class); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane3.setViewportView(jTableFilter); jTableFilter .getColumnModel() .getColumn(0) .setHeaderValue(resourceMap.getString("jTableFilter.columnModel.title0")); // NOI18N jTableFilter .getColumnModel() .getColumn(1) .setHeaderValue(resourceMap.getString("jTableFilter.columnModel.title1")); // NOI18N jTableFilter .getColumnModel() .getColumn(2) .setHeaderValue(resourceMap.getString("jTableFilter.columnModel.title2")); // NOI18N jTableFilter .getColumnModel() .getColumn(3) .setHeaderValue(resourceMap.getString("jTableFilter.columnModel.title3")); // NOI18N jTableFilter .getColumnModel() .getColumn(4) .setHeaderValue(resourceMap.getString("jTableFilter.columnModel.title4")); // NOI18N jButtonSaveFilter.setText(resourceMap.getString("jButtonSaveFilter.text")); // NOI18N jButtonSaveFilter.setName("jButtonSaveFilter"); // NOI18N jButtonRefreshFilter.setText(resourceMap.getString("jButtonRefreshFilter.text")); // NOI18N jButtonRefreshFilter.setName("jButtonRefreshFilter"); // NOI18N jButtonDelFilter.setText(resourceMap.getString("jButtonDelFilter.text")); // NOI18N jButtonDelFilter.setName("jButtonDelFilter"); // NOI18N jButtonNewFilter.setText(resourceMap.getString("jButtonNewFilter.text")); // NOI18N jButtonNewFilter.setName("jButtonNewFilter"); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 1043, Short.MAX_VALUE) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addGap(605, 605, 605) .addComponent(jButtonNewArea) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonDelArea)) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addGap(461, 461, 461) .addComponent(jButtonNewBooking) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonDelBooking) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonRefreshBooking) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonSaveBooking)) .addComponent( jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1043, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1043, Short.MAX_VALUE) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addGap(461, 461, 461) .addComponent(jButtonNewFilter) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonDelFilter) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonRefreshFilter) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonSaveFilter))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addComponent( jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButtonDelArea) .addComponent(jButtonNewArea)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 283, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButtonSaveBooking) .addComponent(jButtonRefreshBooking) .addComponent(jButtonDelBooking) .addComponent(jButtonNewBooking)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButtonSaveFilter) .addComponent(jButtonRefreshFilter) .addComponent(jButtonDelFilter) .addComponent(jButtonNewFilter)) .addContainerGap(50, Short.MAX_VALUE))); bindingGroup.bind(); } // </editor-fold>//GEN-END: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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); radioDBv2PUEntityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("radioDBv2PU") .createEntityManager(); musicGroupQuery = java.beans.Beans.isDesignTime() ? null : radioDBv2PUEntityManager.createQuery("SELECT m FROM MusicGroup m"); musicGroupList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( musicGroupQuery.getResultList()); jScrollPane1 = new javax.swing.JScrollPane(); BandsTable = new javax.swing.JTable(); jLabel1 = new javax.swing.JLabel(); deleteBand = new javax.swing.JButton(); addBand = new javax.swing.JButton(); editBand = new javax.swing.JButton(); exit = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Εγγραφή σε Μάθημα"); BandsTable.setColumnSelectionAllowed(true); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, musicGroupList, BandsTable); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${name}")); columnBinding.setColumnName("Επωνυμία"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${formationDate}")); columnBinding.setColumnName("Ημ/νία δημιουργίας"); columnBinding.setColumnClass(java.util.Date.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane1.setViewportView(BandsTable); BandsTable.getColumnModel() .getSelectionModel() .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); jLabel1.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jLabel1.setText("Πίνακας Συγκροτημάτων"); deleteBand.setText("Διαγραφή"); deleteBand.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deleteBandActionPerformed(evt); } }); addBand.setText("Προσθήκη"); addBand.setToolTipText(""); addBand.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addBandActionPerformed(evt); } }); editBand.setText("Επεξεργασία"); editBand.setToolTipText(""); editBand.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { editBandActionPerformed(evt); } }); exit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/exit.png"))); // NOI18N exit.setToolTipText("Έξοδος"); exit.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGap(26, 26, 26) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGap(158, 158, 158) .addComponent(jLabel1)) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addComponent(addBand) .addGap(37, 37, 37) .addComponent(deleteBand) .addGap(38, 38, 38) .addComponent(editBand)) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE) .addComponent( exit, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap())); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1) .addGap(18, 18, 18) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(addBand) .addComponent(editBand) .addComponent(deleteBand)) .addComponent( exit, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(30, Short.MAX_VALUE))); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END:initComponents
@Override public void cargar() { if (!Beans.isDesignTime() && !isCargado()) { MaimonidesUtil.ejecutarTask(this, "cargarProfesores"); } }
/** * 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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); LibreriaUniformePUEntityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("LibreriaUniformePU") .createEntityManager(); empleadosQuery = java.beans.Beans.isDesignTime() ? null : LibreriaUniformePUEntityManager.createQuery("SELECT e FROM Empleados e"); empleadosList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : empleadosQuery.getResultList(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); eliminar = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); editar = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); lCargo = new javax.swing.JTextField(); identificacion = new javax.swing.JTextField(); nombres = new javax.swing.JTextField(); apellidos = new javax.swing.JTextField(); estado = new javax.swing.JCheckBox(); jScrollPane2 = new javax.swing.JScrollPane(); listArea = new javax.swing.JList(); jScrollPane3 = new javax.swing.JScrollPane(); listCargo = new javax.swing.JList(); lArea = new javax.swing.JTextField(); setTitle("Editar o Eliminar Cargo"); jTable1.setBorder( new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, empleadosList, jTable1); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${idempleados}")); columnBinding.setColumnName("Identificacion"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${nombres}")); columnBinding.setColumnName("Nombres"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${apellidos}")); columnBinding.setColumnName("Apellidos"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${actDes}")); columnBinding.setColumnName("Estado"); columnBinding.setColumnClass(Boolean.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${areasIdareas.area}")); columnBinding.setColumnName("Area"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cargosIdcargos.cargo}")); columnBinding.setColumnName("Cargo"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane1.setViewportView(jTable1); if (jTable1.getColumnModel().getColumnCount() > 0) { jTable1.getColumnModel().getColumn(1).setPreferredWidth(200); } eliminar.setText("Eliminar"); eliminar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { eliminarActionPerformed(evt); } }); jButton2.setText("Salir"); jButton2.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); editar.setText("Editar"); editar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { editarActionPerformed(evt); } }); jLabel1.setText("Identificacion:"); jLabel2.setText("Nombres:"); jLabel3.setText("Apellidos:"); jLabel4.setText("Act/Des"); jLabel5.setText("Area:"); jLabel6.setText("Cargo:"); lCargo.setEditable(false); lCargo.setEnabled(false); lCargo.setOpaque(false); org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, listCargo, org.jdesktop.beansbinding.ELProperty.create( "${selectedElement.cargosIdcargos.idcargos}"), lCargo, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.idempleados}"), identificacion, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.nombres}"), nombres, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.apellidos}"), apellidos, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.actDes}"), estado, org.jdesktop.beansbinding.BeanProperty.create("selected")); bindingGroup.addBinding(binding); org.jdesktop.swingbinding.JListBinding jListBinding = org.jdesktop.swingbinding.SwingBindings.createJListBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, empleadosList, listArea); jListBinding.setDetailBinding( org.jdesktop.beansbinding.ELProperty.create("${areasIdareas.area}")); bindingGroup.addBinding(jListBinding); jScrollPane2.setViewportView(listArea); jListBinding = org.jdesktop.swingbinding.SwingBindings.createJListBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, empleadosList, listCargo); jListBinding.setDetailBinding( org.jdesktop.beansbinding.ELProperty.create("${cargosIdcargos.cargo}")); bindingGroup.addBinding(jListBinding); jScrollPane3.setViewportView(listCargo); lArea.setEditable(false); lArea.setEnabled(false); lArea.setOpaque(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, listArea, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.areasIdareas.idareas}"), lArea, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup( layout .createSequentialGroup() .addComponent(editar) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(eliminar) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton2)) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 792, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment .LEADING) .addComponent(jLabel1) .addComponent(jLabel2) .addComponent(jLabel3) .addComponent(jLabel4) .addComponent(jLabel5) .addComponent( lArea, javax.swing.GroupLayout.Alignment .TRAILING, javax.swing.GroupLayout .PREFERRED_SIZE, 68, javax.swing.GroupLayout .PREFERRED_SIZE)) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment .LEADING, false) .addComponent( jLabel6, javax.swing.GroupLayout .DEFAULT_SIZE, javax.swing.GroupLayout .DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( lCargo, javax.swing.GroupLayout .PREFERRED_SIZE, 33, javax.swing.GroupLayout .PREFERRED_SIZE))) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent( jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment .LEADING) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout .Alignment.LEADING, false) .addComponent( identificacion, javax.swing.GroupLayout .PREFERRED_SIZE, 121, javax.swing.GroupLayout .PREFERRED_SIZE) .addComponent(nombres) .addComponent( apellidos, javax.swing.GroupLayout .DEFAULT_SIZE, 178, Short.MAX_VALUE)) .addComponent(estado)) .addComponent( jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))))) .addContainerGap(23, Short.MAX_VALUE))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addContainerGap() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent( identificacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent( nombres, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent( apellidos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(estado)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup( layout .createSequentialGroup() .addComponent(jLabel5) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( lArea, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent( jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 52, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addComponent(jLabel6) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( lCargo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 21, Short.MAX_VALUE)) .addComponent( jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(eliminar) .addComponent(jButton2)) .addComponent(editar)) .addGap(6, 6, 6))); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END: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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("proyectoPU") .createEntityManager(); query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT a FROM AuditoriaSistema a"); list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( query.getResultList()); jPanel1 = new javax.swing.JPanel(); list_filtros = new javax.swing.JComboBox(); lbl_filtro = new javax.swing.JLabel(); btn_buscar = new javax.swing.JButton(); tf_valor = new javax.swing.JTextField(); lbl_valor = new javax.swing.JLabel(); jScrollPane2 = new javax.swing.JScrollPane(); jTable2 = new javax.swing.JTable(); panel_auditoria = new javax.swing.JPanel(); lbl_auditoria = new javax.swing.JLabel(); btn_cerrar = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Ver Auditoría de Sistema"); jPanel1.setBackground(new java.awt.Color(204, 204, 204)); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); list_filtros.setModel( new javax.swing.DefaultComboBoxModel( new String[] {"Entidad", "Acción", "Usuario", "Fecha"})); list_filtros.addFocusListener( new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { list_filtrosFocusGained(evt); } public void focusLost(java.awt.event.FocusEvent evt) { list_filtrosFocusLost(evt); } }); lbl_filtro.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_filtro.setText("Buscar por:"); btn_buscar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/zoom.png"))); // NOI18N btn_buscar.setText("Buscar"); btn_buscar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_buscarActionPerformed(evt); } }); btn_buscar.addFocusListener( new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { btn_buscarFocusLost(evt); } }); tf_valor.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_valorKeyTyped(evt); } }); lbl_valor.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_valor.setText("Valor:"); 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(18, 18, 18) .addComponent(lbl_filtro) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( list_filtros, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(79, 79, 79) .addComponent(lbl_valor) .addGap(18, 18, 18) .addComponent( tf_valor, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 54, Short.MAX_VALUE) .addComponent( btn_buscar, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(29, 29, 29))); jPanel1Layout.setVerticalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btn_buscar) .addComponent( tf_valor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_valor) .addComponent( list_filtros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_filtro)) .addContainerGap())); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, list, jTable2); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${codigoAuditoria}")); columnBinding.setColumnName("Auditoria"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${usuario}")); columnBinding.setColumnName("Usuario"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${fechaHora}")); columnBinding.setColumnName("Fecha Hora"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${accion}")); columnBinding.setColumnName("Accion"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${tabla}")); columnBinding.setColumnName("Tabla"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${antes}")); columnBinding.setColumnName("Antes"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${despues}")); columnBinding.setColumnName("Despues"); columnBinding.setColumnClass(String.class); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane2.setViewportView(jTable2); if (jTable2.getColumnModel().getColumnCount() > 0) { jTable2.getColumnModel().getColumn(0).setPreferredWidth(30); jTable2.getColumnModel().getColumn(2).setPreferredWidth(75); jTable2.getColumnModel().getColumn(3).setPreferredWidth(50); jTable2.getColumnModel().getColumn(4).setPreferredWidth(50); jTable2.getColumnModel().getColumn(5).setPreferredWidth(100); jTable2.getColumnModel().getColumn(6).setPreferredWidth(100); } panel_auditoria.setBackground(new java.awt.Color(0, 153, 255)); panel_auditoria.setBorder( javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED)); lbl_auditoria.setFont(new java.awt.Font("Corbel", 1, 30)); // NOI18N lbl_auditoria.setForeground(new java.awt.Color(255, 255, 255)); lbl_auditoria.setText("Auditoría de Sistema"); javax.swing.GroupLayout panel_auditoriaLayout = new javax.swing.GroupLayout(panel_auditoria); panel_auditoria.setLayout(panel_auditoriaLayout); panel_auditoriaLayout.setHorizontalGroup( panel_auditoriaLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, panel_auditoriaLayout .createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lbl_auditoria) .addGap(162, 162, 162))); panel_auditoriaLayout.setVerticalGroup( panel_auditoriaLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( panel_auditoriaLayout .createSequentialGroup() .addContainerGap() .addComponent(lbl_auditoria) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); btn_cerrar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/delete.png"))); // NOI18N btn_cerrar.setText("Cancelar"); btn_cerrar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_cerrarActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addContainerGap(20, Short.MAX_VALUE) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addComponent( jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 958, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(21, 21, 21)) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent( jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( panel_auditoria, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(198, 198, 198)))) .addGroup( layout .createSequentialGroup() .addGap(422, 422, 422) .addComponent( btn_cerrar, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGap(18, 18, 18) .addComponent( panel_auditoria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) .addComponent(btn_cerrar) .addGap(33, 33, 33))); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END: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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); reservaRenderizar1 = new renderizar.ReservaRenderizar(); entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("proyectoPU") .createEntityManager(); query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT r FROM Reserva r"); list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : query.getResultList(); reservaQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT r FROM Reserva r"); reservaList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( reservaQuery.getResultList()); jPanel1 = new javax.swing.JPanel(); btn_cancelar = new javax.swing.JButton(); btn_generar = new javax.swing.JButton(); panel_generarFact = new javax.swing.JPanel(); lbl_generarFact = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); tf_categoria = new javax.swing.JTextField(); tf_codigo = new javax.swing.JTextField(); tf_nomApe = new javax.swing.JTextField(); lbl_cedula = new javax.swing.JLabel(); tf_cedula = new javax.swing.JTextField(); lbl_codigo = new javax.swing.JLabel(); tf_habitacion = new javax.swing.JTextField(); lbl_habitación = new javax.swing.JLabel(); lbl_nomApe = new javax.swing.JLabel(); lbl_categoria = new javax.swing.JLabel(); jPanel3 = new javax.swing.JPanel(); tf_valor = new javax.swing.JTextField(); lbl_valor = new javax.swing.JLabel(); lbl_filtro = new javax.swing.JLabel(); list_filtros = new javax.swing.JComboBox(); btn_buscar = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); masterTable = new javax.swing.JTable(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(204, 204, 204)); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); btn_cancelar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/delete.png"))); // NOI18N btn_cancelar.setText("Cancelar"); btn_cancelar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_cancelarActionPerformed(evt); } }); btn_generar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/table.png"))); // NOI18N btn_generar.setText("Generar"); btn_generar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_generarActionPerformed(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(26, 26, 26) .addComponent(btn_generar) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 43, Short.MAX_VALUE) .addComponent(btn_cancelar) .addGap(28, 28, 28))); jPanel1Layout.setVerticalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addComponent(btn_cancelar) .addGap(0, 0, Short.MAX_VALUE)) .addComponent( btn_generar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); panel_generarFact.setBackground(new java.awt.Color(0, 153, 255)); panel_generarFact.setBorder( javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED)); lbl_generarFact.setFont(new java.awt.Font("Corbel", 1, 27)); // NOI18N lbl_generarFact.setForeground(new java.awt.Color(255, 255, 255)); lbl_generarFact.setText("Generar Factura"); javax.swing.GroupLayout panel_generarFactLayout = new javax.swing.GroupLayout(panel_generarFact); panel_generarFact.setLayout(panel_generarFactLayout); panel_generarFactLayout.setHorizontalGroup( panel_generarFactLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( panel_generarFactLayout .createSequentialGroup() .addGap(223, 223, 223) .addComponent(lbl_generarFact) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_generarFactLayout.setVerticalGroup( panel_generarFactLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( panel_generarFactLayout .createSequentialGroup() .addContainerGap() .addComponent(lbl_generarFact) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel2.setBackground(new java.awt.Color(204, 204, 204)); jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); tf_categoria.setEditable(false); tf_categoria.setBackground(new java.awt.Color(0, 153, 255)); tf_categoria.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N tf_categoria.setForeground(new java.awt.Color(255, 255, 255)); tf_codigo.setEditable(false); tf_codigo.setBackground(new java.awt.Color(0, 153, 255)); tf_codigo.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N tf_codigo.setForeground(new java.awt.Color(255, 255, 255)); tf_nomApe.setEditable(false); tf_nomApe.setBackground(new java.awt.Color(0, 153, 255)); tf_nomApe.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N tf_nomApe.setForeground(new java.awt.Color(255, 255, 255)); lbl_cedula.setFont(new java.awt.Font("Candara", 1, 14)); // NOI18N lbl_cedula.setText("Cédula:"); tf_cedula.setEditable(false); tf_cedula.setBackground(new java.awt.Color(0, 153, 255)); tf_cedula.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N tf_cedula.setForeground(new java.awt.Color(255, 255, 255)); lbl_codigo.setFont(new java.awt.Font("Candara", 1, 14)); // NOI18N lbl_codigo.setText("Código Reserva:"); tf_habitacion.setEditable(false); tf_habitacion.setBackground(new java.awt.Color(0, 153, 255)); tf_habitacion.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N tf_habitacion.setForeground(new java.awt.Color(255, 255, 255)); lbl_habitación.setFont(new java.awt.Font("Candara", 1, 14)); // NOI18N lbl_habitación.setText("Habitación:"); lbl_nomApe.setFont(new java.awt.Font("Candara", 1, 14)); // NOI18N lbl_nomApe.setText("Nombre/Apellido:"); lbl_categoria.setFont(new java.awt.Font("Candara", 1, 14)); // NOI18N lbl_categoria.setText("Categoría:"); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addGap(46, 46, 46) .addGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addComponent(lbl_codigo) .addGap(18, 18, 18) .addComponent( tf_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup( jPanel2Layout .createSequentialGroup() .addComponent( lbl_cedula, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( tf_cedula, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE) .addGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addComponent(lbl_habitación) .addGap(42, 42, 42) .addComponent( tf_habitacion, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lbl_categoria) .addGap(31, 31, 31) .addComponent( tf_categoria, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup( jPanel2Layout .createSequentialGroup() .addComponent( lbl_nomApe, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( tf_nomApe, javax.swing.GroupLayout.PREFERRED_SIZE, 273, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(51, 51, 51))); jPanel2Layout.setVerticalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbl_codigo) .addComponent( tf_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_habitación) .addComponent( tf_habitacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_categoria) .addComponent( tf_categoria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(31, 31, 31) .addGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbl_cedula) .addComponent( tf_cedula, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_nomApe) .addComponent( tf_nomApe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(27, Short.MAX_VALUE))); jPanel3.setBackground(new java.awt.Color(204, 204, 204)); jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jPanel3.setForeground(new java.awt.Color(204, 204, 255)); tf_valor.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_valorKeyTyped(evt); } }); lbl_valor.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_valor.setText("Valor:"); lbl_filtro.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_filtro.setText("Buscar por:"); list_filtros.setModel( new javax.swing.DefaultComboBoxModel( new String[] {"Cedula", "Nombre", "Apellido", "Habitación", "CheckIn", "CheckOut"})); list_filtros.addFocusListener( new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { list_filtrosFocusLost(evt); } }); btn_buscar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/zoom.png"))); // NOI18N btn_buscar.setText("Buscar"); btn_buscar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_buscarActionPerformed(evt); } }); btn_buscar.addFocusListener( new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { btn_buscarFocusLost(evt); } }); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addGap(29, 29, 29) .addComponent(lbl_filtro) .addGap(18, 18, 18) .addComponent( list_filtros, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(78, 78, 78) .addComponent(lbl_valor) .addGap(18, 18, 18) .addComponent( tf_valor, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 61, Short.MAX_VALUE) .addComponent(btn_buscar) .addGap(53, 53, 53))); jPanel3Layout.setVerticalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbl_filtro) .addComponent(lbl_valor) .addComponent( list_filtros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( tf_valor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btn_buscar)) .addContainerGap())); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, reservaList, masterTable); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${codigoReserva}")); columnBinding.setColumnName(" Reserva"); columnBinding.setColumnClass(Integer.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${numHabitacion.numero}")); columnBinding.setColumnName(" Habitacion"); columnBinding.setColumnClass(Integer.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${numHabitacion.codigoCategoria.nombre}")); columnBinding.setColumnName("Categoría"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${checkIn}")); columnBinding.setColumnName("Check In"); columnBinding.setColumnClass(java.util.Date.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${checkOut}")); columnBinding.setColumnName("Check Out"); columnBinding.setColumnClass(java.util.Date.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${codigoCliente.cedula}")); columnBinding.setColumnName("CI Cliente"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${codigoCliente.nombre}")); columnBinding.setColumnName("Nombre"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${codigoCliente.apellido}")); columnBinding.setColumnName("Apellido"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); masterTable.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { masterTableMouseClicked(evt); } }); jScrollPane1.setViewportView(masterTable); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGap(30, 30, 30) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 744, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup( layout .createSequentialGroup() .addGap(58, 58, 58) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment .LEADING, false) .addComponent( panel_generarFact, javax.swing.GroupLayout .DEFAULT_SIZE, javax.swing.GroupLayout .DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jPanel3, javax.swing.GroupLayout .DEFAULT_SIZE, javax.swing.GroupLayout .DEFAULT_SIZE, Short.MAX_VALUE))))) .addGroup( layout .createSequentialGroup() .addGap(239, 239, 239) .addComponent( jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(32, Short.MAX_VALUE))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addComponent( panel_generarFact, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(19, Short.MAX_VALUE))); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END: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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); EntityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("proyectoPU") .createEntityManager(); Query = java.beans.Beans.isDesignTime() ? null : EntityManager.createQuery("SELECT a FROM Actividad a"); List = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( Query.getResultList()); panel_EditarAct = new javax.swing.JPanel(); lbl_EditarAct = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); lbl_nombre = new javax.swing.JLabel(); tf_nombre = new javax.swing.JTextField(); lbl_codigo = new javax.swing.JLabel(); tf_codigo = new javax.swing.JTextField(); jPanel2 = new javax.swing.JPanel(); btn_cancelar = new javax.swing.JButton(); btn_eliminar = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); tf_valor = new javax.swing.JTextField(); lbl_valor = new javax.swing.JLabel(); lbl_filtro = new javax.swing.JLabel(); list_filtros = new javax.swing.JComboBox(); btn_buscar = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); masterTable = new javax.swing.JTable(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); panel_EditarAct.setBackground(new java.awt.Color(0, 153, 255)); panel_EditarAct.setBorder( javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED)); lbl_EditarAct.setFont(new java.awt.Font("Corbel", 1, 30)); // NOI18N lbl_EditarAct.setForeground(new java.awt.Color(255, 255, 255)); lbl_EditarAct.setText("Eliminar Actividad"); javax.swing.GroupLayout panel_EditarActLayout = new javax.swing.GroupLayout(panel_EditarAct); panel_EditarAct.setLayout(panel_EditarActLayout); panel_EditarActLayout.setHorizontalGroup( panel_EditarActLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( panel_EditarActLayout .createSequentialGroup() .addGap(139, 139, 139) .addComponent(lbl_EditarAct) .addContainerGap(141, Short.MAX_VALUE))); panel_EditarActLayout.setVerticalGroup( panel_EditarActLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( panel_EditarActLayout .createSequentialGroup() .addContainerGap() .addComponent(lbl_EditarAct) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel1.setBackground(new java.awt.Color(204, 204, 204)); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); lbl_nombre.setFont(new java.awt.Font("Candara", 1, 14)); // NOI18N lbl_nombre.setText("Nombre:"); tf_nombre.setEditable(false); tf_nombre.setBackground(new java.awt.Color(0, 153, 255)); tf_nombre.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N tf_nombre.setForeground(new java.awt.Color(255, 255, 255)); tf_nombre.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tf_nombreActionPerformed(evt); } }); tf_nombre.addFocusListener( new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { tf_nombreFocusLost(evt); } }); tf_nombre.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_nombreKeyTyped(evt); } }); lbl_codigo.setFont(new java.awt.Font("Candara", 1, 14)); // NOI18N lbl_codigo.setText("Código:"); tf_codigo.setEditable(false); tf_codigo.setBackground(new java.awt.Color(0, 153, 255)); tf_codigo.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N tf_codigo.setForeground(new java.awt.Color(255, 255, 255)); 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(47, 47, 47) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lbl_nombre) .addComponent(lbl_codigo)) .addGap(32, 32, 32) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( tf_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( tf_nombre, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbl_codigo) .addComponent( tf_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbl_nombre) .addComponent( tf_nombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(24, 24, 24))); jPanel2.setBackground(new java.awt.Color(204, 204, 204)); jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); btn_cancelar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/delete.png"))); // NOI18N btn_cancelar.setText("Cancelar"); btn_cancelar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_cancelarActionPerformed(evt); } }); btn_eliminar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/trash.png"))); // NOI18N btn_eliminar.setText("Eliminar"); btn_eliminar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_eliminarActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addGap(23, 23, 23) .addComponent(btn_eliminar) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 52, Short.MAX_VALUE) .addComponent(btn_cancelar) .addGap(19, 19, 19))); jPanel2Layout.setVerticalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addComponent(btn_cancelar) .addGap(0, 0, Short.MAX_VALUE)) .addComponent( btn_eliminar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); jPanel3.setBackground(new java.awt.Color(204, 204, 204)); jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jPanel3.setForeground(new java.awt.Color(204, 204, 255)); tf_valor.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_valorKeyTyped(evt); } }); lbl_valor.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_valor.setText("Valor:"); lbl_filtro.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_filtro.setText("Buscar por:"); list_filtros.setModel( new javax.swing.DefaultComboBoxModel(new String[] {"Código", "Descripción"})); list_filtros.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { list_filtrosActionPerformed(evt); } }); list_filtros.addFocusListener( new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { list_filtrosFocusGained(evt); } }); btn_buscar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/zoom.png"))); // NOI18N btn_buscar.setText("Buscar"); btn_buscar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_buscarActionPerformed(evt); } }); btn_buscar.addFocusListener( new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { btn_buscarFocusLost(evt); } }); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addContainerGap() .addComponent(lbl_filtro) .addGap(18, 18, 18) .addComponent( list_filtros, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(26, 26, 26) .addComponent(lbl_valor) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( tf_valor, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(btn_buscar) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbl_filtro) .addComponent(lbl_valor) .addComponent( list_filtros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( tf_valor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btn_buscar)) .addContainerGap())); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, List, masterTable); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${codActividad}")); columnBinding.setColumnName("Actividad"); columnBinding.setColumnClass(Integer.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${nombre}")); columnBinding.setColumnName("Nombre"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); masterTable.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { masterTableMouseClicked(evt); } }); jScrollPane1.setViewportView(masterTable); if (masterTable.getColumnModel().getColumnCount() > 0) { masterTable.getColumnModel().getColumn(0).setPreferredWidth(15); } javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGap(37, 37, 37) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 519, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( panel_EditarAct, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup( layout .createSequentialGroup() .addGap(148, 148, 148) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 39, Short.MAX_VALUE)) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent( jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jScrollPane1)) .addGap(71, 71, 71))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addComponent( panel_EditarAct, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(23, Short.MAX_VALUE))); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END: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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("proyectoPU") .createEntityManager(); query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT m FROM MovimientoStock m"); list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( query.getResultList()); detalleOrdenCompraQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT d FROM DetalleOrdenCompra d"); detalleOrdenCompraList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : detalleOrdenCompraQuery.getResultList(); empleadoQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT e FROM Empleado e"); empleadoList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : empleadoQuery.getResultList(); ordenCompraQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT o FROM OrdenCompra o"); ordenCompraList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : ordenCompraQuery.getResultList(); jPanel3 = new javax.swing.JPanel(); lbl_registrarC = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); lbl_nombre = new javax.swing.JLabel(); cantidadMinimaLabel = new javax.swing.JLabel(); tf_articulo = new javax.swing.JTextField(); tf_cantidad = new javax.swing.JTextField(); cantidadMinimaLabel1 = new javax.swing.JLabel(); tf_fecha = new javax.swing.JTextField(); lbl_nombre1 = new javax.swing.JLabel(); tf_codigo = new javax.swing.JTextField(); jPanel6 = new javax.swing.JPanel(); btn_cancelar3 = new javax.swing.JButton(); btn_guardar = new javax.swing.JButton(); btn_modificar = new javax.swing.JButton(); btn_eliminar = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); lbl_valor = new javax.swing.JLabel(); tf_valor = new javax.swing.JTextField(); lbl_filtro = new javax.swing.JLabel(); list_filtros = new javax.swing.JComboBox(); btn_buscar = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); masterTable = new javax.swing.JTable(); FormListener formListener = new FormListener(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel3.setBackground(new java.awt.Color(0, 153, 255)); jPanel3.setBorder( javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED)); lbl_registrarC.setFont(new java.awt.Font("Corbel", 1, 30)); // NOI18N lbl_registrarC.setForeground(new java.awt.Color(255, 255, 255)); lbl_registrarC.setText("Modificar/Eliminar Extraccion de Articulo:"); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addGap(89, 89, 89) .addComponent(lbl_registrarC) .addContainerGap(120, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout .createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lbl_registrarC) .addContainerGap())); jPanel1.setBackground(new java.awt.Color(204, 204, 204)); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); lbl_nombre.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_nombre.setText("Articulo:"); cantidadMinimaLabel.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N cantidadMinimaLabel.setText("Cantidad:"); tf_articulo.setEnabled(false); tf_cantidad.setEnabled(false); tf_cantidad.addFocusListener(formListener); tf_cantidad.addKeyListener(formListener); cantidadMinimaLabel1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N cantidadMinimaLabel1.setText("Fecha:"); tf_fecha.setEnabled(false); lbl_nombre1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_nombre1.setText("Codigo:"); tf_codigo.setEnabled(false); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lbl_nombre) .addComponent(cantidadMinimaLabel) .addComponent(cantidadMinimaLabel1) .addComponent(lbl_nombre1)) .addGap(42, 42, 42) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent( tf_articulo, javax.swing.GroupLayout.DEFAULT_SIZE, 214, Short.MAX_VALUE) .addComponent( tf_cantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tf_fecha)) .addComponent( tf_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addGap(13, 13, 13) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbl_nombre1) .addComponent( tf_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( tf_articulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_nombre, javax.swing.GroupLayout.Alignment.TRAILING)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cantidadMinimaLabel) .addComponent( tf_cantidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cantidadMinimaLabel1) .addComponent( tf_fecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel6.setBackground(new java.awt.Color(204, 204, 204)); jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder()); btn_cancelar3.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/delete.png"))); // NOI18N btn_cancelar3.setText("Cancelar"); btn_cancelar3.addActionListener(formListener); btn_guardar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/guardar.png"))); // NOI18N btn_guardar.setText("Guardar"); btn_guardar.setEnabled(false); btn_guardar.addActionListener(formListener); btn_modificar.setText("Modificar"); btn_modificar.setEnabled(false); btn_modificar.addActionListener(formListener); btn_eliminar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/trash.png"))); // NOI18N btn_eliminar.setText("Eliminar"); btn_eliminar.setEnabled(false); btn_eliminar.addActionListener(formListener); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup( jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel6Layout .createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btn_modificar) .addGap(29, 29, 29) .addComponent(btn_guardar) .addGap(28, 28, 28) .addComponent(btn_eliminar) .addGap(33, 33, 33) .addComponent(btn_cancelar3) .addGap(34, 34, 34))); jPanel6Layout.setVerticalGroup( jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel6Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btn_cancelar3) .addComponent( btn_guardar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btn_modificar) .addComponent( btn_eliminar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel2.setBackground(new java.awt.Color(204, 204, 204)); jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); lbl_valor.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_valor.setText("Valor:"); tf_valor.addKeyListener(formListener); lbl_filtro.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_filtro.setText("Buscar por:"); list_filtros.setModel( new javax.swing.DefaultComboBoxModel(new String[] {"Código", "Articulo"})); list_filtros.addMouseListener(formListener); btn_buscar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/zoom.png"))); // NOI18N btn_buscar.setText("Buscar"); btn_buscar.addActionListener(formListener); btn_buscar.addFocusListener(formListener); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addGap(36, 36, 36) .addComponent(lbl_filtro) .addGap(18, 18, 18) .addComponent( list_filtros, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lbl_valor) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( tf_valor, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(btn_buscar) .addGap(36, 36, 36))); jPanel2Layout.setVerticalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbl_filtro) .addComponent( list_filtros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_valor) .addComponent( tf_valor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btn_buscar)) .addContainerGap())); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, list, masterTable); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${codigoMovimiento}")); columnBinding.setColumnName("Codigo Movimiento"); columnBinding.setColumnClass(Integer.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${codigoArticulo.nombre}")); columnBinding.setColumnName("Articulo"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${cantidad}")); columnBinding.setColumnName("Cantidad"); columnBinding.setColumnClass(Integer.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${fechaHora}")); columnBinding.setColumnName("Fecha Hora"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); masterTable.addMouseListener(formListener); jScrollPane1.setViewportView(masterTable); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, 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(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent( jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) .addGroup( layout .createSequentialGroup() .addGap(146, 146, 146) .addComponent( jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE) .addComponent( jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(43, 43, 43))); bindingGroup.bind(); pack(); }
public DivisionData() { initComponents(); if (!Beans.isDesignTime()) { entityManager.getTransaction().begin(); } }
/** * 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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(javaproject.Main.class) .getContext() .getResourceMap(DivisionData.class); entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory( resourceMap.getString("entityManager.persistenceUnit")) .createEntityManager(); // NOI18N query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery(resourceMap.getString("query.query")); // NOI18N list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( query.getResultList()); masterScrollPane = new javax.swing.JScrollPane(); masterTable = new javax.swing.JTable(); stationNumberLabel = new javax.swing.JLabel(); address1Label = new javax.swing.JLabel(); address2Label = new javax.swing.JLabel(); telephoneLabel = new javax.swing.JLabel(); stationNameLabel = new javax.swing.JLabel(); stationNumberField = new javax.swing.JTextField(); address1Field = new javax.swing.JTextField(); address2Field = new javax.swing.JTextField(); telephoneField = new javax.swing.JTextField(); stationNameField = new javax.swing.JTextField(); saveButton = new javax.swing.JButton(); refreshButton = new javax.swing.JButton(); newButton = new javax.swing.JButton(); deleteButton = new javax.swing.JButton(); FormListener formListener = new FormListener(); setName("Form"); // NOI18N masterScrollPane.setName("masterScrollPane"); // NOI18N masterTable.setName("masterTable"); // NOI18N org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, list, masterTable); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${stationNumber}")); columnBinding.setColumnName("Station Number"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${address1}")); columnBinding.setColumnName("Address1"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${address2}")); columnBinding.setColumnName("Address2"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${telephone}")); columnBinding.setColumnName("Telephone"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${stationName}")); columnBinding.setColumnName("Station Name"); columnBinding.setColumnClass(String.class); bindingGroup.addBinding(jTableBinding); masterScrollPane.setViewportView(masterTable); stationNumberLabel.setText(resourceMap.getString("stationNumberLabel.text")); // NOI18N stationNumberLabel.setName("stationNumberLabel"); // NOI18N address1Label.setText(resourceMap.getString("address1Label.text")); // NOI18N address1Label.setName("address1Label"); // NOI18N address2Label.setText(resourceMap.getString("address2Label.text")); // NOI18N address2Label.setName("address2Label"); // NOI18N telephoneLabel.setText(resourceMap.getString("telephoneLabel.text")); // NOI18N telephoneLabel.setName("telephoneLabel"); // NOI18N stationNameLabel.setText(resourceMap.getString("stationNameLabel.text")); // NOI18N stationNameLabel.setName("stationNameLabel"); // NOI18N stationNumberField.setName("stationNumberField"); // NOI18N org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.stationNumber}"), stationNumberField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), stationNumberField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); address1Field.setName("address1Field"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.address1}"), address1Field, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), address1Field, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); address2Field.setName("address2Field"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.address2}"), address2Field, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), address2Field, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); telephoneField.setName("telephoneField"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.telephone}"), telephoneField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), telephoneField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); stationNameField.setName("stationNameField"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.stationName}"), stationNameField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), stationNameField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); saveButton.setText(resourceMap.getString("saveButton.text")); // NOI18N saveButton.setName("saveButton"); // NOI18N saveButton.addActionListener(formListener); refreshButton.setText(resourceMap.getString("refreshButton.text")); // NOI18N refreshButton.setName("refreshButton"); // NOI18N refreshButton.addActionListener(formListener); newButton.setText(resourceMap.getString("newButton.text")); // NOI18N newButton.setName("newButton"); // NOI18N newButton.addActionListener(formListener); deleteButton.setText(resourceMap.getString("deleteButton.text")); // NOI18N deleteButton.setName("deleteButton"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), deleteButton, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); deleteButton.addActionListener(formListener); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addComponent(newButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(deleteButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(refreshButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(saveButton) .addContainerGap()) .addGroup( layout .createSequentialGroup() .addContainerGap() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(stationNumberLabel) .addComponent(address1Label) .addComponent(address2Label) .addComponent(telephoneLabel) .addComponent(stationNameLabel)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( stationNumberField, javax.swing.GroupLayout.DEFAULT_SIZE, 315, Short.MAX_VALUE) .addComponent( address1Field, javax.swing.GroupLayout.DEFAULT_SIZE, 315, Short.MAX_VALUE) .addComponent( address2Field, javax.swing.GroupLayout.DEFAULT_SIZE, 315, Short.MAX_VALUE) .addComponent( telephoneField, javax.swing.GroupLayout.DEFAULT_SIZE, 315, Short.MAX_VALUE) .addComponent( stationNameField, javax.swing.GroupLayout.DEFAULT_SIZE, 315, Short.MAX_VALUE)) .addContainerGap()) .addGroup( layout .createSequentialGroup() .addContainerGap() .addComponent( masterScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE) .addContainerGap())); layout.linkSize( javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {deleteButton, newButton, refreshButton, saveButton}); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addComponent( masterScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(stationNumberLabel) .addComponent( stationNumberField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(address1Label) .addComponent( address1Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(address2Label) .addComponent( address2Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(telephoneLabel) .addComponent( telephoneField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(stationNameLabel) .addComponent( stationNameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(saveButton) .addComponent(refreshButton) .addComponent(deleteButton) .addComponent(newButton)) .addContainerGap())); bindingGroup.bind(); }
/** * 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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("proyectoPU") .createEntityManager(); query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT p FROM Proveedor p"); list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( query.getResultList()); categoriaArticuloQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT c FROM CategoriaArticulo c"); categoriaArticuloList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : categoriaArticuloQuery.getResultList(); jPanel1 = new javax.swing.JPanel(); tf_telef = new javax.swing.JTextField(); tf_email = new javax.swing.JTextField(); lbl_direccion = new javax.swing.JLabel(); lbl_ruc = new javax.swing.JLabel(); tf_ruc = new javax.swing.JTextField(); tf_cedula = new javax.swing.JTextField(); lbl_email = new javax.swing.JLabel(); tf_direccion = new javax.swing.JTextField(); lbl_razonSocial = new javax.swing.JLabel(); lbl_telef = new javax.swing.JLabel(); tf_razonSocial = new javax.swing.JTextField(); lbl_apellido1 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); combotipo = new javax.swing.JComboBox(); lbl_cedula1 = new javax.swing.JLabel(); lbl_telef1 = new javax.swing.JLabel(); combo_cat = new javax.swing.JComboBox(); jPanel2 = new javax.swing.JPanel(); btn_cancelar = new javax.swing.JButton(); btn_guardar = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); lbl_registrarC = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setResizable(false); jPanel1.setBackground(new java.awt.Color(204, 204, 204)); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); tf_telef.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_telefKeyTyped(evt); } }); tf_email.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tf_emailActionPerformed(evt); } }); tf_email.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_emailKeyTyped(evt); } }); lbl_direccion.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_direccion.setText("Dirección:"); lbl_ruc.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_ruc.setText("RUC:"); tf_ruc.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tf_rucActionPerformed(evt); } }); tf_ruc.addFocusListener( new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { tf_rucFocusLost(evt); } }); tf_ruc.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_rucKeyTyped(evt); } }); tf_cedula.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tf_cedulaActionPerformed(evt); } }); tf_cedula.addFocusListener( new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { tf_cedulaFocusLost(evt); } }); tf_cedula.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_cedulaKeyTyped(evt); } }); lbl_email.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_email.setText("Email:"); tf_direccion.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_direccionKeyTyped(evt); } }); lbl_razonSocial.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_razonSocial.setText("Razon Social:"); lbl_telef.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_telef.setText("Teléfono:"); tf_razonSocial.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tf_razonSocialActionPerformed(evt); } }); tf_razonSocial.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_razonSocialKeyTyped(evt); } }); lbl_apellido1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_apellido1.setText("Tipo"); jLabel1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N jLabel1.setText("'N': Natural o 'J': Juridico"); combotipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] {"N", "J"})); combotipo.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { combotipoMouseClicked(evt); } }); combotipo.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { combotipoActionPerformed(evt); } }); lbl_cedula1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_cedula1.setText("Cedula:"); lbl_telef1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_telef1.setText("Categoria Proveedor:"); org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, categoriaArticuloList, combo_cat); bindingGroup.addBinding(jComboBoxBinding); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lbl_razonSocial) .addComponent(lbl_ruc) .addComponent(lbl_apellido1) .addComponent(lbl_cedula1) .addComponent(lbl_telef1)) .addGap(32, 32, 32) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addGroup( jPanel1Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( tf_razonSocial, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup( jPanel1Layout .createSequentialGroup() .addComponent( combotipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement .RELATED) .addComponent(jLabel1)) .addComponent( tf_ruc, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( tf_cedula, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup( jPanel1Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addGap(49, 49, 49) .addGroup( jPanel1Layout .createParallelGroup( javax.swing.GroupLayout.Alignment .LEADING) .addComponent(lbl_email) .addComponent(lbl_direccion))) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout .createSequentialGroup() .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement .RELATED) .addComponent(lbl_telef)))) .addComponent( combo_cat, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 75, Short.MAX_VALUE) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( tf_email, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( tf_direccion, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( tf_telef, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(20, 20, 20))); jPanel1Layout.setVerticalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addGap(19, 19, 19) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbl_apellido1) .addComponent(jLabel1) .addComponent( combotipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(26, 26, 26) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( tf_email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_email) .addComponent(lbl_razonSocial) .addComponent( tf_razonSocial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( tf_ruc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_ruc) .addComponent(lbl_direccion) .addComponent( tf_direccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(21, 21, 21) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( tf_cedula, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_cedula1) .addComponent( tf_telef, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_telef)) .addGap(18, 18, 18) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( combo_cat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_telef1)) .addContainerGap(36, Short.MAX_VALUE))); jPanel2.setBackground(new java.awt.Color(204, 204, 204)); jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); btn_cancelar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/delete.png"))); // NOI18N btn_cancelar.setText("Cancelar"); btn_cancelar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_cancelarActionPerformed(evt); } }); btn_guardar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/guardar.png"))); // NOI18N btn_guardar.setText("Guardar"); btn_guardar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_guardarActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addGap(34, 34, 34) .addComponent(btn_guardar) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 63, Short.MAX_VALUE) .addComponent(btn_cancelar) .addGap(34, 34, 34))); jPanel2Layout.setVerticalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addComponent(btn_cancelar) .addGap(0, 0, Short.MAX_VALUE)) .addComponent( btn_guardar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); jPanel3.setBackground(new java.awt.Color(0, 153, 255)); jPanel3.setBorder( javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED)); lbl_registrarC.setFont(new java.awt.Font("Corbel", 1, 30)); // NOI18N lbl_registrarC.setForeground(new java.awt.Color(255, 255, 255)); lbl_registrarC.setText("Crear Proveedor"); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addGap(128, 128, 128) .addComponent(lbl_registrarC) .addContainerGap(226, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addContainerGap() .addComponent(lbl_registrarC) .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) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addComponent( jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup( layout .createSequentialGroup() .addGap(64, 64, 64) .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) .addGroup( layout .createSequentialGroup() .addGap(132, 132, 132) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addGap(20, 20, 20) .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(29, 29, 29) .addComponent( jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(18, 18, 18) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32))); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END: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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("proyectoPU") .createEntityManager(); rolQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT r FROM Rol r"); rolList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( rolQuery.getResultList()); usuarioQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT u FROM Usuario u"); usuarioList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( usuarioQuery.getResultList()); jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); tf_idEmpleado = new javax.swing.JTextField(); tf_nombreUsuario = new javax.swing.JTextField(); tf_apellidoUsuario = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); btn_guardar = new javax.swing.JButton(); btn_cancelar = new javax.swing.JButton(); panel_editarUsuario = new javax.swing.JPanel(); lbl_editarUsuario = new javax.swing.JLabel(); jScrollPane2 = new javax.swing.JScrollPane(); masterTableUsuario = new javax.swing.JTable(); jPanel3 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); list_filtros = new javax.swing.JComboBox(); jLabel4 = new javax.swing.JLabel(); tf_valor = new javax.swing.JTextField(); btn_buscar = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); rolTable = new javax.swing.JTable(); btn_agregarRol = new javax.swing.JButton(); btn_limpiar = new javax.swing.JButton(); jLabel6 = new javax.swing.JLabel(); btn_limpiar1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); setResizable(false); jPanel1.setBackground(new java.awt.Color(204, 204, 204)); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jPanel1.setForeground(new java.awt.Color(204, 204, 255)); jLabel1.setFont(new java.awt.Font("Candara", 0, 16)); // NOI18N jLabel1.setText("Código:"); jLabel3.setFont(new java.awt.Font("Candara", 0, 16)); // NOI18N jLabel3.setText("Nombre:"); tf_idEmpleado.setEnabled(false); org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTableUsuario, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.codigoEmpleado}"), tf_idEmpleado, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); tf_nombreUsuario.setEnabled(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTableUsuario, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.empleado.nombre}"), tf_nombreUsuario, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); tf_apellidoUsuario.setEnabled(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTableUsuario, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.empleado.apellido}"), tf_apellidoUsuario, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel5.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N jLabel5.setText("Datos del Usuario"); 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(37, 37, 37) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jLabel3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel5) .addGroup( jPanel1Layout .createSequentialGroup() .addGap(10, 10, 10) .addGroup( jPanel1Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( tf_nombreUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( tf_idEmpleado, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( tf_apellidoUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap(43, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addGap(8, 8, 8) .addComponent(jLabel5) .addGap(10, 10, 10) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent( tf_idEmpleado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent( tf_nombreUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( tf_apellidoUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(32, Short.MAX_VALUE))); jPanel2.setBackground(new java.awt.Color(204, 204, 204)); jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); btn_guardar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/guardar.png"))); // NOI18N btn_guardar.setText("Modificar"); btn_guardar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_guardarActionPerformed(evt); } }); btn_cancelar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/excluded.png"))); // NOI18N btn_cancelar.setText("Salir"); btn_cancelar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_cancelarActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addGap(25, 25, 25) .addComponent(btn_guardar) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 125, Short.MAX_VALUE) .addComponent(btn_cancelar) .addGap(34, 34, 34))); jPanel2Layout.linkSize( javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btn_cancelar, btn_guardar}); jPanel2Layout.setVerticalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( btn_guardar, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( btn_cancelar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_editarUsuario.setBackground(new java.awt.Color(0, 153, 255)); panel_editarUsuario.setBorder( javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED)); lbl_editarUsuario.setFont(new java.awt.Font("Corbel", 1, 30)); // NOI18N lbl_editarUsuario.setForeground(new java.awt.Color(255, 255, 255)); lbl_editarUsuario.setText("Editar Usuario"); javax.swing.GroupLayout panel_editarUsuarioLayout = new javax.swing.GroupLayout(panel_editarUsuario); panel_editarUsuario.setLayout(panel_editarUsuarioLayout); panel_editarUsuarioLayout.setHorizontalGroup( panel_editarUsuarioLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, panel_editarUsuarioLayout .createSequentialGroup() .addContainerGap(141, Short.MAX_VALUE) .addComponent(lbl_editarUsuario) .addGap(138, 138, 138))); panel_editarUsuarioLayout.setVerticalGroup( panel_editarUsuarioLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( panel_editarUsuarioLayout .createSequentialGroup() .addContainerGap() .addComponent(lbl_editarUsuario) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, usuarioList, masterTableUsuario); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${codigoEmpleado}")); columnBinding.setColumnName("Codigo"); columnBinding.setColumnClass(Integer.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${empleado.nombre}")); columnBinding.setColumnName("Nombre"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${empleado.apellido}")); columnBinding.setColumnName("Apellido"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); masterTableUsuario.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { masterTableUsuarioMouseClicked(evt); } }); jScrollPane2.setViewportView(masterTableUsuario); jPanel3.setBackground(new java.awt.Color(204, 204, 204)); jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jPanel3.setForeground(new java.awt.Color(204, 204, 255)); jLabel2.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N jLabel2.setText("Buscar por:"); list_filtros.setModel( new javax.swing.DefaultComboBoxModel(new String[] {"Código", "Nombre", "Apellido"})); list_filtros.addFocusListener( new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { list_filtrosFocusGained(evt); } }); jLabel4.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N jLabel4.setText("Valor:"); tf_valor.addKeyListener( new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { tf_valorKeyPressed(evt); } public void keyTyped(java.awt.event.KeyEvent evt) { tf_valorKeyTyped(evt); } }); btn_buscar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/zoom.png"))); // NOI18N btn_buscar.setText("Buscar"); btn_buscar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_buscarActionPerformed(evt); } }); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addContainerGap() .addComponent(jLabel2) .addGap(18, 18, 18) .addComponent( list_filtros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(40, 40, 40) .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( tf_valor, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 50, Short.MAX_VALUE) .addComponent(btn_buscar) .addGap(23, 23, 23))); jPanel3Layout.setVerticalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent( list_filtros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4) .addComponent( tf_valor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btn_buscar)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, rolList, rolTable); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${idRol}")); columnBinding.setColumnName("Código"); columnBinding.setColumnClass(Integer.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${nombre}")); columnBinding.setColumnName("Nombre"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); rolTable.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { rolTableMouseClicked(evt); } }); jScrollPane1.setViewportView(rolTable); if (rolTable.getColumnModel().getColumnCount() > 0) { rolTable.getColumnModel().getColumn(0).setMinWidth(60); rolTable.getColumnModel().getColumn(0).setPreferredWidth(60); rolTable.getColumnModel().getColumn(0).setMaxWidth(60); } btn_agregarRol.setText("Mostrar Roles"); btn_agregarRol.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_agregarRolActionPerformed(evt); } }); btn_limpiar.setText("Sacar Todos"); btn_limpiar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_limpiarActionPerformed(evt); } }); jLabel6.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N jLabel6.setText("Roles"); btn_limpiar1.setText("Sacar Rol"); btn_limpiar1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_limpiar1ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGap(20, 20, 20) .addComponent( jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btn_agregarRol) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( btn_limpiar1, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( btn_limpiar, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGap(27, 27, 27) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup( layout .createSequentialGroup() .addGap(138, 138, 138) .addComponent(jLabel6))) .addGap(0, 0, Short.MAX_VALUE))) .addGap(28, 28, 28)) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGap(80, 80, 80) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 519, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup( layout .createSequentialGroup() .addGap(108, 108, 108) .addComponent( panel_editarUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(163, 163, 163))); layout.linkSize( javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btn_agregarRol, btn_limpiar}); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addComponent( panel_editarUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(11, 11, 11) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup( layout .createSequentialGroup() .addGap(12, 12, 12) .addComponent( jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup( layout .createSequentialGroup() .addComponent(jLabel6) .addGap(10, 10, 10) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btn_agregarRol) .addComponent(btn_limpiar) .addComponent(btn_limpiar1)))) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); layout.linkSize( javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {btn_agregarRol, btn_limpiar}); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END: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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); mainPanel = new javax.swing.JPanel(); masterScrollPane = new javax.swing.JScrollPane(); masterTable = new javax.swing.JTable(); idLabel = new javax.swing.JLabel(); imeLabel = new javax.swing.JLabel(); prezimeLabel = new javax.swing.JLabel(); adresaLabel = new javax.swing.JLabel(); brojlicneLabel = new javax.swing.JLabel(); sifraotiskaLabel = new javax.swing.JLabel(); idField = new javax.swing.JTextField(); imeField = new javax.swing.JTextField(); prezimeField = new javax.swing.JTextField(); adresaField = new javax.swing.JTextField(); brojlicneField = new javax.swing.JTextField(); sifraotiskaField = new javax.swing.JTextField(); saveButton = new javax.swing.JButton(); refreshButton = new javax.swing.JButton(); newButton = new javax.swing.JButton(); deleteButton = new javax.swing.JButton(); menuBar = new javax.swing.JMenuBar(); javax.swing.JMenu fileMenu = new javax.swing.JMenu(); javax.swing.JMenuItem newRecordMenuItem = new javax.swing.JMenuItem(); javax.swing.JMenuItem deleteRecordMenuItem = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JSeparator(); javax.swing.JMenuItem saveMenuItem = new javax.swing.JMenuItem(); javax.swing.JMenuItem refreshMenuItem = new javax.swing.JMenuItem(); jSeparator2 = new javax.swing.JSeparator(); javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem(); statusPanel = new javax.swing.JPanel(); javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator(); statusMessageLabel = new javax.swing.JLabel(); statusAnimationLabel = new javax.swing.JLabel(); progressBar = new javax.swing.JProgressBar(); org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance( fingerprintapplication.FingerprintApplication.class) .getContext() .getResourceMap(FingerprintView.class); entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory( resourceMap.getString("entityManager.persistenceUnit")) .createEntityManager(); // NOI18N query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery(resourceMap.getString("query.query")); // NOI18N list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( query.getResultList()); mainPanel.setName("mainPanel"); // NOI18N masterScrollPane.setName("masterScrollPane"); // NOI18N masterTable.setName("masterTable"); // NOI18N org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, list, masterTable); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}")); columnBinding.setColumnName("Id"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${ime}")); columnBinding.setColumnName("Ime"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${prezime}")); columnBinding.setColumnName("Prezime"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${adresa}")); columnBinding.setColumnName("Adresa"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${brojlicne}")); columnBinding.setColumnName("Brojlicne"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${sifraotiska}")); columnBinding.setColumnName("Sifraotiska"); columnBinding.setColumnClass(String.class); bindingGroup.addBinding(jTableBinding); masterScrollPane.setViewportView(masterTable); idLabel.setText(resourceMap.getString("idLabel.text")); // NOI18N idLabel.setName("idLabel"); // NOI18N imeLabel.setText(resourceMap.getString("imeLabel.text")); // NOI18N imeLabel.setName("imeLabel"); // NOI18N prezimeLabel.setText(resourceMap.getString("prezimeLabel.text")); // NOI18N prezimeLabel.setName("prezimeLabel"); // NOI18N adresaLabel.setText(resourceMap.getString("adresaLabel.text")); // NOI18N adresaLabel.setName("adresaLabel"); // NOI18N brojlicneLabel.setText(resourceMap.getString("brojlicneLabel.text")); // NOI18N brojlicneLabel.setName("brojlicneLabel"); // NOI18N sifraotiskaLabel.setText(resourceMap.getString("sifraotiskaLabel.text")); // NOI18N sifraotiskaLabel.setName("sifraotiskaLabel"); // NOI18N idField.setName("idField"); // NOI18N org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.id}"), idField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), idField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); imeField.setName("imeField"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.ime}"), imeField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), imeField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); prezimeField.setName("prezimeField"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.prezime}"), prezimeField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), prezimeField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); adresaField.setName("adresaField"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.adresa}"), adresaField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), adresaField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); brojlicneField.setName("brojlicneField"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.brojlicne}"), brojlicneField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), brojlicneField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); sifraotiskaField.setName("sifraotiskaField"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.sifraotiska}"), sifraotiskaField, org.jdesktop.beansbinding.BeanProperty.create("text")); binding.setSourceUnreadableValue(null); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), sifraotiskaField, org.jdesktop.beansbinding.BeanProperty.create("enabled")); bindingGroup.addBinding(binding); javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance( fingerprintapplication.FingerprintApplication.class) .getContext() .getActionMap(FingerprintView.class, this); saveButton.setAction(actionMap.get("save")); // NOI18N saveButton.setText(resourceMap.getString("saveButton.text")); // NOI18N saveButton.setName("saveButton"); // NOI18N refreshButton.setAction(actionMap.get("refresh")); // NOI18N refreshButton.setText(resourceMap.getString("refreshButton.text")); // NOI18N refreshButton.setName("refreshButton"); // NOI18N newButton.setAction(actionMap.get("newRecord")); // NOI18N newButton.setText(resourceMap.getString("newButton.text")); // NOI18N newButton.setName("newButton"); // NOI18N deleteButton.setAction(actionMap.get("deleteRecord")); // NOI18N deleteButton.setText(resourceMap.getString("deleteButton.text")); // NOI18N deleteButton.setName("deleteButton"); // NOI18N javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel); mainPanel.setLayout(mainPanelLayout); mainPanelLayout.setHorizontalGroup( mainPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( mainPanelLayout .createSequentialGroup() .addGroup( mainPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout .createSequentialGroup() .addComponent(newButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(deleteButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(refreshButton) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(saveButton)) .addGroup( mainPanelLayout .createSequentialGroup() .addContainerGap() .addGroup( mainPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(idLabel) .addComponent(imeLabel) .addComponent(prezimeLabel) .addComponent(adresaLabel) .addComponent(brojlicneLabel) .addComponent(sifraotiskaLabel)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( mainPanelLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( idField, javax.swing.GroupLayout.DEFAULT_SIZE, 369, Short.MAX_VALUE) .addComponent( imeField, javax.swing.GroupLayout.DEFAULT_SIZE, 369, Short.MAX_VALUE) .addComponent( prezimeField, javax.swing.GroupLayout.DEFAULT_SIZE, 369, Short.MAX_VALUE) .addComponent( adresaField, javax.swing.GroupLayout.DEFAULT_SIZE, 369, Short.MAX_VALUE) .addComponent( brojlicneField, javax.swing.GroupLayout.DEFAULT_SIZE, 369, Short.MAX_VALUE) .addComponent( sifraotiskaField, javax.swing.GroupLayout.DEFAULT_SIZE, 369, Short.MAX_VALUE))) .addGroup( mainPanelLayout .createSequentialGroup() .addContainerGap() .addComponent( masterScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 427, Short.MAX_VALUE))) .addContainerGap())); mainPanelLayout.linkSize( javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {deleteButton, newButton, refreshButton, saveButton}); mainPanelLayout.setVerticalGroup( mainPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( mainPanelLayout .createSequentialGroup() .addContainerGap() .addComponent( masterScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( mainPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(idLabel) .addComponent( idField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( mainPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(imeLabel) .addComponent( imeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( mainPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(prezimeLabel) .addComponent( prezimeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( mainPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(adresaLabel) .addComponent( adresaField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( mainPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(brojlicneLabel) .addComponent( brojlicneField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( mainPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(sifraotiskaLabel) .addComponent( sifraotiskaField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( mainPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(saveButton) .addComponent(refreshButton) .addComponent(deleteButton) .addComponent(newButton)) .addContainerGap())); menuBar.setName("menuBar"); // NOI18N fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N fileMenu.setName("fileMenu"); // NOI18N newRecordMenuItem.setAction(actionMap.get("newRecord")); // NOI18N newRecordMenuItem.setText(resourceMap.getString("newRecordMenuItem.text")); // NOI18N newRecordMenuItem.setName("newRecordMenuItem"); // NOI18N fileMenu.add(newRecordMenuItem); deleteRecordMenuItem.setAction(actionMap.get("deleteRecord")); // NOI18N deleteRecordMenuItem.setText(resourceMap.getString("deleteRecordMenuItem.text")); // NOI18N deleteRecordMenuItem.setName("deleteRecordMenuItem"); // NOI18N fileMenu.add(deleteRecordMenuItem); jSeparator1.setName("jSeparator1"); // NOI18N fileMenu.add(jSeparator1); saveMenuItem.setAction(actionMap.get("save")); // NOI18N saveMenuItem.setText(resourceMap.getString("saveMenuItem.text")); // NOI18N saveMenuItem.setName("saveMenuItem"); // NOI18N fileMenu.add(saveMenuItem); refreshMenuItem.setAction(actionMap.get("refresh")); // NOI18N refreshMenuItem.setText(resourceMap.getString("refreshMenuItem.text")); // NOI18N refreshMenuItem.setName("refreshMenuItem"); // NOI18N fileMenu.add(refreshMenuItem); jSeparator2.setName("jSeparator2"); // NOI18N fileMenu.add(jSeparator2); exitMenuItem.setAction(actionMap.get("quit")); // NOI18N exitMenuItem.setText(resourceMap.getString("exitMenuItem.text")); // NOI18N exitMenuItem.setName("exitMenuItem"); // NOI18N fileMenu.add(exitMenuItem); menuBar.add(fileMenu); statusPanel.setName("statusPanel"); // NOI18N statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N statusMessageLabel.setName("statusMessageLabel"); // NOI18N statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N progressBar.setName("progressBar"); // NOI18N javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel); statusPanel.setLayout(statusPanelLayout); statusPanelLayout.setHorizontalGroup( statusPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 447, Short.MAX_VALUE) .addGroup( statusPanelLayout .createSequentialGroup() .addContainerGap() .addComponent(statusMessageLabel) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 277, Short.MAX_VALUE) .addComponent( progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(statusAnimationLabel) .addContainerGap())); statusPanelLayout.setVerticalGroup( statusPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( statusPanelLayout .createSequentialGroup() .addComponent( statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup( statusPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(statusMessageLabel) .addComponent(statusAnimationLabel) .addComponent( progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(3, 3, 3))); setComponent(mainPanel); setMenuBar(menuBar); setStatusBar(statusPanel); bindingGroup.bind(); } // </editor-fold>//GEN-END: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">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("proyectoPU") .createEntityManager(); informerecepcionQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT i FROM Informerecepcion i"); informerecepcionList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : informerecepcionQuery.getResultList(); query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT o FROM OrdenCompra o"); list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( query.getResultList()); detalleOrdenCompraQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT d FROM DetalleOrdenCompra d"); detalleOrdenCompraList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : detalleOrdenCompraQuery.getResultList(); panel_BuscarPS = new javax.swing.JPanel(); lbl_BuscarPS = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); lbl_valor = new javax.swing.JLabel(); tf_valor = new javax.swing.JTextField(); lbl_filtro = new javax.swing.JLabel(); list_filtros = new javax.swing.JComboBox(); btn_buscar = new javax.swing.JButton(); masterScrollPane = new javax.swing.JScrollPane(); masterTable = new javax.swing.JTable(); jPanel4 = new javax.swing.JPanel(); btn_cancelar = new javax.swing.JButton(); btn_imprimir = new javax.swing.JButton(); masterScrollPane1 = new javax.swing.JScrollPane(); masterTableDetalle = new javax.swing.JTable(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); panel_BuscarPS.setBackground(new java.awt.Color(0, 153, 255)); panel_BuscarPS.setBorder( javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED)); lbl_BuscarPS.setFont(new java.awt.Font("Corbel", 1, 30)); // NOI18N lbl_BuscarPS.setForeground(new java.awt.Color(255, 255, 255)); lbl_BuscarPS.setText("Ordenes de Compra"); javax.swing.GroupLayout panel_BuscarPSLayout = new javax.swing.GroupLayout(panel_BuscarPS); panel_BuscarPS.setLayout(panel_BuscarPSLayout); panel_BuscarPSLayout.setHorizontalGroup( panel_BuscarPSLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( panel_BuscarPSLayout .createSequentialGroup() .addGap(156, 156, 156) .addComponent(lbl_BuscarPS) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_BuscarPSLayout.setVerticalGroup( panel_BuscarPSLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, panel_BuscarPSLayout .createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lbl_BuscarPS) .addContainerGap())); jPanel1.setBackground(new java.awt.Color(204, 204, 204)); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); lbl_valor.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_valor.setText("Valor:"); tf_valor.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_valorKeyTyped(evt); } }); lbl_filtro.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_filtro.setText("Buscar por:"); list_filtros.setModel( new javax.swing.DefaultComboBoxModel(new String[] {"Codigo", "Proveedor", "Articulo"})); list_filtros.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { list_filtrosMouseClicked(evt); } }); list_filtros.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { list_filtrosActionPerformed(evt); } }); btn_buscar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/zoom.png"))); // NOI18N btn_buscar.setText("Buscar"); btn_buscar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_buscarActionPerformed(evt); } }); btn_buscar.addFocusListener( new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { btn_buscarFocusLost(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(36, 36, 36) .addComponent(lbl_filtro) .addGap(18, 18, 18) .addComponent( list_filtros, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 70, Short.MAX_VALUE) .addComponent(lbl_valor) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( tf_valor, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(btn_buscar) .addGap(36, 36, 36))); jPanel1Layout.setVerticalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbl_filtro) .addComponent( list_filtros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_valor) .addComponent( tf_valor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btn_buscar)) .addContainerGap())); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, list, masterTable); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${codOrden}")); columnBinding.setColumnName("Cod Orden"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${codProveedor.razonSocial}")); columnBinding.setColumnName("Proveedor"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${fecha}")); columnBinding.setColumnName("Fecha"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); masterTable.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { masterTableMouseClicked(evt); } }); masterScrollPane.setViewportView(masterTable); jPanel4.setBackground(new java.awt.Color(204, 204, 204)); jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder()); btn_cancelar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/delete.png"))); // NOI18N btn_cancelar.setText("Cancelar"); btn_cancelar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_cancelarActionPerformed(evt); } }); btn_imprimir.setText("Imprimir"); btn_imprimir.setEnabled(false); btn_imprimir.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_imprimirActionPerformed(evt); } }); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel4Layout .createSequentialGroup() .addGap(85, 85, 85) .addComponent(btn_imprimir) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 100, Short.MAX_VALUE) .addComponent(btn_cancelar) .addGap(25, 25, 25))); jPanel4Layout.setVerticalGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel4Layout .createSequentialGroup() .addContainerGap(25, Short.MAX_VALUE) .addGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(btn_imprimir) .addComponent(btn_cancelar)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); masterTableDetalle.setEnabled(false); jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, detalleOrdenCompraList, masterTableDetalle); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${codArticulo.nombre}")); columnBinding.setColumnName("Articulo"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cantidadPedida}")); columnBinding.setColumnName("Cantidad Pedida"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cantidadRecibida}")); columnBinding.setColumnName("Cantidad Recibida"); columnBinding.setColumnClass(Integer.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); masterTableDetalle.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { masterTableDetalleMouseClicked(evt); } }); masterScrollPane1.setViewportView(masterTableDetalle); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( panel_BuscarPS, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup( layout .createSequentialGroup() .addGap(10, 10, 10) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( masterScrollPane, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup( layout .createSequentialGroup() .addComponent( jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))) .addComponent(masterScrollPane1)) .addContainerGap()) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(120, 120, 120))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addComponent( panel_BuscarPS, 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.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( masterScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent( masterScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END:initComponents