Пример #1
0
  public void refresh() throws IOException {

    blookupService.setServiceName("/getByLookupId");
    bLookups =
        new ObjectMapper()
            .readValue(
                new RESTfulClientUtil()
                    .restFullService(
                        blookupService.getServerUrl(),
                        blookupService.getServiceName(),
                        new ObjectMapper().writeValueAsString(lookup.getId())),
                new TypeReference<List<BLookup>>() {});

    JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            bLookups,
            mainTable,
            "");
    JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${code}"));
    columnBinding.setColumnName("CODE");
    columnBinding.setColumnClass(String.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("${persianName}"));
    columnBinding.setColumnName("PERSIANNAME");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${description}"));
    columnBinding.setColumnName("DESC");
    columnBinding.setColumnClass(String.class);
    BindingGroup bindingGroup = new BindingGroup();
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
  }
 /**
  * It changes the availability of buttons based in the selected bean
  *
  * @param selectedSource
  */
 private void customizePanel(SpatialBean selectedSource) {
   cmdRemove.setEnabled(selectedSource != null);
   org.jdesktop.beansbinding.ELProperty eLProperty =
       org.jdesktop.beansbinding.ELProperty.create("${beanList}");
   org.jdesktop.swingbinding.JTableBinding jTableBinding =
       org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
           org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
           cadastreObjectListBean,
           eLProperty,
           tableCadastreObject);
   org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
       jTableBinding.addColumnBinding(
           org.jdesktop.beansbinding.ELProperty.create("${nameFirstpart}"));
   columnBinding.setColumnName("Name Firstpart");
   columnBinding.setColumnClass(String.class);
   columnBinding =
       jTableBinding.addColumnBinding(
           org.jdesktop.beansbinding.ELProperty.create("${nameLastpart}"));
   columnBinding.setColumnName("Name Lastpart");
   columnBinding.setColumnClass(String.class);
   columnBinding.setEditable(true);
   columnBinding =
       jTableBinding.addColumnBinding(
           org.jdesktop.beansbinding.ELProperty.create("${officialArea}"));
   columnBinding.setColumnName("Official Area");
   columnBinding.setColumnClass(Double.class);
   bindingGroup.addBinding(jTableBinding);
   jTableBinding.bind();
   org.jdesktop.beansbinding.Binding binding =
       org.jdesktop.beansbinding.Bindings.createAutoBinding(
           org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
           cadastreObjectListBean,
           org.jdesktop.beansbinding.ELProperty.create("${selectedBean}"),
           tableCadastreObject,
           org.jdesktop.beansbinding.BeanProperty.create("selectedElement"));
   bindingGroup.addBinding(binding);
 }
Пример #3
0
  private void processColumns(Column[] columns) {
    normalColumnModel = new DefaultTableColumnModelExt();

    BeanProperty itemsProperty = BeanProperty.create("items");
    jTableBinding =
        SwingBindings.createJTableBinding(
            AutoBinding.UpdateStrategy.READ_WRITE, this, itemsProperty, this);

    for (int i = 0; i < columns.length; i++) {
      Column column = columns[i];
      JTableBinding.ColumnBinding columnBinding =
          jTableBinding.addColumnBinding(column.getProperty());
      columnBinding.setColumnName(column.getId());
      columnBinding.setColumnClass(column.getType());
      columnBinding.setConverter(column.getConverter());
      columnBinding.setEditable(column.isEditable());
      column.setModelIndex(i);
      normalColumnModel.addColumn(column);
    }

    jTableBinding.bind();
    setColumnModel(normalColumnModel);
  }
Пример #4
0
  /**
   * 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();
  }
Пример #5
0
  /**
   * 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
  private void llenarjTBalanceComprobacion() throws Exception {

    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    contabilidadBBMayorAuxiliar1 =
        new shrimp.contabilidad.beanbinding.ContabilidadBBMayorAuxiliar();
    /*
     * 101050101001 201070101004
     */
    obtenerRangoCuentas();
    List<contabilidad.TO.ConMayorAuxiliarTO> conMayorAuxiliarMultipleTOs =
        new java.util.ArrayList(1);
    List<contabilidad.TO.ConMayorAuxiliarTO> conMayorAuxiliarMultipleAuxTOs = null;
    contabilidad.TO.ConMayorAuxiliarTO conMayorAuxiliarMultipleAuxTO = null;
    for (ConCuentasTO conCuentasTO : contabilidadBBCuentas.getListaConCuentasTO()) {
      contabilidadBBMayorAuxiliar1.setListaConMayorAuxiliarTO(
          shrimp.contabilidad.delegate.ContabilidadDelegate.getInstance()
              .getListaMayorAuxiliarTO(
                  sisUsuarioEmpresaTO.getEmpCodigo(),
                  conCuentasTO.getCuentaCodigo(),
                  fechaDesde,
                  fechaHasta,
                  codigoSector));
      conMayorAuxiliarMultipleAuxTOs = contabilidadBBMayorAuxiliar1.getListaConMayorAuxiliarTO();
      int posicion = 0;
      for (contabilidad.TO.ConMayorAuxiliarTO conMayorAuxiliarMultipleTO :
          conMayorAuxiliarMultipleAuxTOs) {
        if (posicion == 0) {
          conMayorAuxiliarMultipleTO.setMaContable(
              conCuentasTO.getCuentaCodigo() + " | " + conCuentasTO.getCuentaDetalle());
          conMayorAuxiliarMultipleTO.setMaCuenta("");
        } else {
          conMayorAuxiliarMultipleTO.setMaCuenta(conCuentasTO.getCuentaCodigo());
          conMayorAuxiliarMultipleTO.setMaCuentaDetalle(conCuentasTO.getCuentaDetalle());
        }
        conMayorAuxiliarMultipleTOs.add(conMayorAuxiliarMultipleTO);
        posicion++;
      }
      conMayorAuxiliarMultipleAuxTO = new contabilidad.TO.ConMayorAuxiliarTO();
      conMayorAuxiliarMultipleTOs.add(conMayorAuxiliarMultipleAuxTO);
    }
    this.contabilidadBBMayorAuxiliar1.setListaConMayorAuxiliarTO(conMayorAuxiliarMultipleTOs);
    this.bindingGroup.bind();

    this.jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_ONCE,
            this.contabilidadBBMayorAuxiliar1.getListaConMayorAuxiliarTO(),
            jtable);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding0 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maContable}"));
    columnBinding0.setColumnName("Contable");
    columnBinding0.setColumnClass(String.class);
    columnBinding0.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding1 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maCuenta}"));
    columnBinding1.setColumnName("Cuenta");
    columnBinding1.setColumnClass(String.class);
    columnBinding1.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding2 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maCuentaDetalle}"));
    columnBinding2.setColumnName("Cuenta Detalle");
    columnBinding2.setColumnClass(String.class);
    columnBinding2.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding3 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maFecha}"));
    columnBinding3.setColumnName("Fecha");
    columnBinding3.setColumnClass(String.class);
    columnBinding3.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding4 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maDocumento}"));
    columnBinding4.setColumnName("Documento");
    columnBinding4.setColumnClass(String.class);
    columnBinding4.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding5 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maDebe}"));
    columnBinding5.setColumnName("Debe");
    columnBinding5.setColumnClass(java.math.BigDecimal.class);
    columnBinding5.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding6 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maHaber}"));
    columnBinding6.setColumnName("Haber");
    columnBinding6.setColumnClass(java.math.BigDecimal.class);
    columnBinding6.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding7 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maSaldo}"));
    columnBinding7.setColumnName("Saldo");
    columnBinding7.setColumnClass(java.math.BigDecimal.class);
    columnBinding7.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding8 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maObservaciones}"));
    columnBinding8.setColumnName("Observaciones");
    columnBinding8.setColumnClass(String.class);
    columnBinding8.setEditable(false);

    /// java.math.BigDecimal
    this.bindingGroup.addBinding(this.jTableBinding);
    this.bindingGroup.bind();

    jtable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
    // Metemos el modelo ordenable en la tabla.
    javax.swing.table.TableRowSorter modeloOrdenado =
        new javax.swing.table.TableRowSorter(jtable.getModel());
    jtable.setRowSorter(modeloOrdenado);

    ///// PARA CAMBIAR EL ANCHO DE LAS COLUMNAS
    javax.swing.table.TableColumn col = null;
    col = jtable.getColumnModel().getColumn(0);
    col.setPreferredWidth(200);
    col = jtable.getColumnModel().getColumn(1);
    col.setPreferredWidth(100);
    col = jtable.getColumnModel().getColumn(2);
    col.setPreferredWidth(100);
    col = jtable.getColumnModel().getColumn(3);
    col.setPreferredWidth(80);
    col = jtable.getColumnModel().getColumn(4);
    col.setPreferredWidth(80);
    col = jtable.getColumnModel().getColumn(5);
    col.setPreferredWidth(80);
    col = jtable.getColumnModel().getColumn(6);
    col.setPreferredWidth(400);
  }
Пример #7
0
  /**
   * 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();

    surveyPointListBean = createBean();
    urbanRural = new javax.swing.ButtonGroup();
    optionRural = new javax.swing.JRadioButton();
    txtY = new javax.swing.JTextField();
    optionUrban = new javax.swing.JRadioButton();
    cmdAdd = new javax.swing.JButton();
    cmdRemove = new javax.swing.JButton();
    txtAcceptableShift = new javax.swing.JTextField();
    txtStandardDeviation = new javax.swing.JTextField();
    txtMeanShift = new javax.swing.JTextField();
    txtX = new javax.swing.JTextField();
    jScrollPane1 = new javax.swing.JScrollPane();
    tablePointList = new javax.swing.JTable();
    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();

    urbanRural.add(optionRural);
    optionRural.setSelected(true);
    java.util.ResourceBundle bundle =
        java.util.ResourceBundle.getBundle(
            "org/sola/clients/swing/gis/ui/control/Bundle"); // NOI18N
    optionRural.setText(bundle.getString("SurveyPointListPanel.optionRural.text")); // NOI18N
    optionRural.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            optionRuralActionPerformed(evt);
          }
        });

    urbanRural.add(optionUrban);
    optionUrban.setText(bundle.getString("SurveyPointListPanel.optionUrban.text")); // NOI18N
    optionUrban.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            optionUrbanActionPerformed(evt);
          }
        });

    cmdAdd.setText(bundle.getString("SurveyPointListPanel.cmdAdd.text")); // NOI18N
    cmdAdd.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            cmdAddActionPerformed(evt);
          }
        });

    cmdRemove.setText(bundle.getString("SurveyPointListPanel.cmdRemove.text")); // NOI18N
    cmdRemove.setEnabled(false);
    cmdRemove.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            cmdRemoveActionPerformed(evt);
          }
        });

    txtAcceptableShift.setEditable(false);

    txtStandardDeviation.setEditable(false);

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            surveyPointListBean,
            org.jdesktop.beansbinding.ELProperty.create("${standardDeviation}"),
            txtStandardDeviation,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    txtMeanShift.setEditable(false);

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            surveyPointListBean,
            org.jdesktop.beansbinding.ELProperty.create("${mean}"),
            txtMeanShift,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    org.jdesktop.beansbinding.ELProperty eLProperty =
        org.jdesktop.beansbinding.ELProperty.create("${beanList}");
    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            surveyPointListBean,
            eLProperty,
            tablePointList);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}"));
    columnBinding.setColumnName("Id");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${x}"));
    columnBinding.setColumnName("X");
    columnBinding.setColumnClass(Double.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${y}"));
    columnBinding.setColumnName("Y");
    columnBinding.setColumnClass(Double.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${boundary}"));
    columnBinding.setColumnName("Boundary");
    columnBinding.setColumnClass(Boolean.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${linked}"));
    columnBinding.setColumnName("Linked");
    columnBinding.setColumnClass(Boolean.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${shiftDistance}"));
    columnBinding.setColumnName("Shift Distance");
    columnBinding.setColumnClass(Double.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            surveyPointListBean,
            org.jdesktop.beansbinding.ELProperty.create("${selectedBean}"),
            tablePointList,
            org.jdesktop.beansbinding.BeanProperty.create("selectedElement"));
    bindingGroup.addBinding(binding);

    jScrollPane1.setViewportView(tablePointList);
    tablePointList.getColumnModel().getColumn(0).setPreferredWidth(5);
    tablePointList
        .getColumnModel()
        .getColumn(0)
        .setHeaderValue(
            bundle.getString("SurveyPointListPanel.tablePointList.columnModel.title0")); // NOI18N
    tablePointList.getColumnModel().getColumn(1).setPreferredWidth(20);
    tablePointList
        .getColumnModel()
        .getColumn(1)
        .setHeaderValue(
            bundle.getString("SurveyPointListPanel.tablePointList.columnModel.title1")); // NOI18N
    tablePointList.getColumnModel().getColumn(2).setPreferredWidth(20);
    tablePointList
        .getColumnModel()
        .getColumn(2)
        .setHeaderValue(
            bundle.getString("SurveyPointListPanel.tablePointList.columnModel.title2")); // NOI18N
    tablePointList.getColumnModel().getColumn(3).setPreferredWidth(20);
    tablePointList
        .getColumnModel()
        .getColumn(3)
        .setHeaderValue(
            bundle.getString("SurveyPointListPanel.tablePointList.columnModel.title3")); // NOI18N
    tablePointList.getColumnModel().getColumn(4).setPreferredWidth(20);
    tablePointList
        .getColumnModel()
        .getColumn(4)
        .setHeaderValue(
            bundle.getString("SurveyPointListPanel.tablePointList.columnModel.title4")); // NOI18N
    tablePointList
        .getColumnModel()
        .getColumn(5)
        .setHeaderValue(
            bundle.getString("SurveyPointListPanel.tablePointList.columnModel.title5")); // NOI18N

    jLabel1.setText(bundle.getString("SurveyPointListPanel.jLabel1.text")); // NOI18N

    jLabel2.setText(bundle.getString("SurveyPointListPanel.jLabel2.text")); // NOI18N

    jLabel3.setText(bundle.getString("SurveyPointListPanel.jLabel3.text")); // NOI18N

    jLabel4.setText(bundle.getString("SurveyPointListPanel.jLabel4.text")); // NOI18N

    jLabel5.setText(bundle.getString("SurveyPointListPanel.jLabel5.text")); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        txtMeanShift,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        57,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addComponent(jLabel2)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        txtStandardDeviation,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        53,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(
                                        optionUrban,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        68,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(optionRural)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jLabel5)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        txtAcceptableShift,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        53,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                564,
                                Short.MAX_VALUE)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(0, 0, Short.MAX_VALUE)
                                    .addComponent(jLabel3)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        txtX,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        96,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jLabel4)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        txtY,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        94,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(cmdAdd)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(cmdRemove)))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                txtMeanShift,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                txtStandardDeviation,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(optionUrban)
                            .addComponent(optionRural)
                            .addComponent(
                                txtAcceptableShift,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(jLabel5))
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                txtY,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                txtX,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(cmdAdd)
                            .addComponent(cmdRemove)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4))
                    .addGap(6, 6, 6)
                    .addComponent(
                        jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
                    .addContainerGap()));

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
Пример #8
0
  /**
   * 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
Пример #9
0
  /**
   * 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
Пример #10
0
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    jLabel1 = new javax.swing.JLabel();
    txtName = new javax.swing.JTextField();
    jLabel2 = new javax.swing.JLabel();
    txtDescription = new javax.swing.JTextField();
    jScrollPane1 = new javax.swing.JScrollPane();
    tableRoles = new org.sola.clients.swing.common.controls.JTableWithDefaultStyles();
    jLabel3 = new javax.swing.JLabel();

    java.util.ResourceBundle bundle =
        java.util.ResourceBundle.getBundle("org/sola/clients/swing/ui/security/Bundle"); // NOI18N
    jLabel1.setText(bundle.getString("GroupPanel.jLabel1.text")); // NOI18N
    jLabel1.setName("jLabel1"); // NOI18N

    txtName.setName("txtName"); // NOI18N

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${group.name}"),
            txtName,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    jLabel2.setText(bundle.getString("GroupPanel.jLabel2.text")); // NOI18N
    jLabel2.setName("jLabel2"); // NOI18N

    txtDescription.setName("txtDescription"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${group.description}"),
            txtDescription,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    tableRoles.setName("tableRoles"); // NOI18N

    org.jdesktop.beansbinding.ELProperty eLProperty =
        org.jdesktop.beansbinding.ELProperty.create("${groupRoleHelperList.groupRoleHelpers}");
    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            eLProperty,
            tableRoles);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${inGroup}"));
    columnBinding.setColumnName("In Group");
    columnBinding.setColumnClass(Boolean.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${role.displayValue}"));
    columnBinding.setColumnName("Role.display Value");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${role.description}"));
    columnBinding.setColumnName("Role.description");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    jScrollPane1.setViewportView(tableRoles);
    tableRoles.getColumnModel().getColumn(0).setPreferredWidth(40);
    tableRoles.getColumnModel().getColumn(0).setMaxWidth(40);
    tableRoles
        .getColumnModel()
        .getColumn(0)
        .setHeaderValue(bundle.getString("GroupPanel.tableRoles.columnModel.title0_1")); // NOI18N
    tableRoles.getColumnModel().getColumn(1).setPreferredWidth(160);
    tableRoles.getColumnModel().getColumn(1).setMaxWidth(160);
    tableRoles
        .getColumnModel()
        .getColumn(1)
        .setHeaderValue(bundle.getString("GroupPanel.tableRoles.columnModel.title1_1")); // NOI18N
    tableRoles
        .getColumnModel()
        .getColumn(2)
        .setHeaderValue(bundle.getString("GroupPanel.tableRoles.columnModel.title2_1")); // NOI18N
    tableRoles.getColumnModel().getColumn(2).setCellRenderer(new TableCellTextAreaRenderer());

    jLabel3.setText(bundle.getString("GroupPanel.jLabel3.text")); // NOI18N
    jLabel3.setName("jLabel3"); // NOI18N

    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()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                534,
                                Short.MAX_VALUE)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.LEADING,
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel1)
                                            .addComponent(
                                                txtName,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                246,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(18, 18, 18)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(jLabel2)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED,
                                                        213,
                                                        Short.MAX_VALUE))
                                            .addComponent(
                                                txtDescription,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                270,
                                                Short.MAX_VALUE)))
                            .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel2)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        txtDescription,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        txtName,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(18, 18, 18)
                    .addComponent(jLabel3)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)));

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
  private void llenarjTable() throws Exception {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
    eLProperty = org.jdesktop.beansbinding.ELProperty.create("${listaConsolidadoBonosViaticosTO}");
    bindingGroup.bind();

    this.bbRRHHFunciones.setListaConsolidadoBonosViaticosTO(
        shrimp.rrhh.delegate.RrhhDelegate.getInstance()
            .getRhConsolidadoBonosViaticosTO(
                sisUsuarioEmpresaTO.getEmpCodigo(), fechaDesde, fechaHasta));
    this.bindingGroup.bind(); // consigue los datos
    this.jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_ONCE,
            this.bbRRHHFunciones.getListaConsolidadoBonosViaticosTO(),
            jtable);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${cbvCategoria}"));
    columnBinding.setColumnName("Categoria");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding1 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${cbvId}"));
    columnBinding1.setColumnName("ID");
    columnBinding1.setColumnClass(String.class);
    columnBinding1.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding2 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${cbvNombres}")); // ${nombreAtributo}
    columnBinding2.setColumnName("Nombres");
    columnBinding2.setColumnClass(String.class);
    columnBinding2.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding3 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${cbvBonos}"));
    columnBinding3.setColumnName("Bonos");
    columnBinding3.setColumnClass(java.math.BigDecimal.class);
    columnBinding3.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding4 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${cbvBonosND}"));
    columnBinding4.setColumnName("Bonos ND");
    columnBinding4.setColumnClass(java.math.BigDecimal.class);
    columnBinding4.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding5 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${cbvBonoFijo}"));
    columnBinding5.setColumnName("Bono Fijo");
    columnBinding5.setColumnClass(java.math.BigDecimal.class);
    columnBinding5.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding6 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${cbvBonoFijoND}"));
    columnBinding6.setColumnName("Bono Fijo ND");
    columnBinding6.setColumnClass(java.math.BigDecimal.class);
    columnBinding6.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding7 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${cbvViaticos}"));
    columnBinding7.setColumnName("Viaticos");
    columnBinding7.setColumnClass(java.math.BigDecimal.class);
    columnBinding7.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding8 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${cbvTotal}"));
    columnBinding8.setColumnName("Total");
    columnBinding8.setColumnClass(java.math.BigDecimal.class);
    columnBinding8.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding9 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${cbvOrden}"));
    columnBinding9.setColumnName("Orden");
    columnBinding9.setColumnClass(String.class);
    columnBinding9.setEditable(false);

    this.bindingGroup.addBinding(this.jTableBinding);
    this.bindingGroup.bind();
    ///// PARA CAMBIAR EL ANCHO DE LAS COLUMNAS
    javax.swing.table.TableColumn col = null;
    col = jtable.getColumnModel().getColumn(0);
    col.setPreferredWidth(70);
    col = jtable.getColumnModel().getColumn(1);
    col.setPreferredWidth(90);
    col = jtable.getColumnModel().getColumn(2);
    col.setPreferredWidth(90);
    col = jtable.getColumnModel().getColumn(3);
    col.setPreferredWidth(300);

    jtable.setColumnSelectionAllowed(true);
    jtable.repaint();
    jtable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
    // Metemos el modelo ordenable en la tabla.
    javax.swing.table.TableRowSorter modeloOrdenado =
        new javax.swing.table.TableRowSorter(jtable.getModel());
    jtable.setRowSorter(modeloOrdenado);
  }
  private void llenarjTableUtilidades() throws Exception {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
    //        bindingGroup.bind();
    this.rRHHBBFunciones.setRhFunXivSueldoConsultarTO(
        shrimp.rrhh.delegate.RrhhDelegate.getInstance()
            .getRhFunConsultarXivSueldo(
                accion.equals("CANCELAR") ? "" : sisUsuarioEmpresaTO.getEmpCodigo(),
                sector,
                fechaDesde,
                fechaHasta));
    this.bindingGroup.bind(); // consigue los datos
    this.jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_ONCE,
            this.rRHHBBFunciones.getRhFunUtilidadesConsultarTOs(),
            jtblXiiiSueldo);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${utiCategoria}"));
    columnBinding.setColumnName("Categoría");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding1 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${utiSector}"));
    columnBinding1.setColumnName("Sector");
    columnBinding1.setColumnClass(String.class);
    columnBinding1.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding2 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${utiId}")); // ${nombreAtributo}
    columnBinding2.setColumnName("Id");
    columnBinding2.setColumnClass(String.class);
    columnBinding2.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding3 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${utiApellidos} ${utiNombres}"));
    columnBinding3.setColumnName("Nombres");
    columnBinding3.setColumnClass(String.class);
    columnBinding3.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding4 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${utiGenero}"));
    columnBinding4.setColumnName("Género");
    columnBinding4.setColumnClass(Character.class);
    columnBinding4.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding5 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${utiFechaIngreso}"));
    columnBinding5.setColumnName("Fecha Ingreso");
    columnBinding5.setColumnClass(String.class);
    columnBinding5.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding6 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${utiCargo}"));
    columnBinding6.setColumnName("Cargo");
    columnBinding6.setColumnClass(String.class);
    columnBinding6.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding7 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${utiTotalIngresos}"));
    columnBinding7.setColumnName("Total Ingresos");
    columnBinding7.setColumnClass(java.math.BigDecimal.class);
    columnBinding7.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding8 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${utiDiasLaborados}"));
    columnBinding8.setColumnName("Días Laborados");
    columnBinding8.setColumnClass(Short.class);
    columnBinding8.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding9 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${utiValorUtilidades}"));
    columnBinding9.setColumnName("Valor Utilidades");
    columnBinding9.setColumnClass(java.math.BigDecimal.class);
    columnBinding9.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding10 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${utiCodigoMinisterial}"));
    columnBinding10.setColumnName("Código Ministerial");
    columnBinding10.setColumnClass(String.class);
    columnBinding10.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding11 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${utiPeriodo}|${utiTipo}|${utiNumero}"));
    columnBinding11.setColumnName("Contable");
    columnBinding11.setColumnClass(String.class);
    columnBinding11.setEditable(false);

    this.bindingGroup.addBinding(this.jTableBinding);
    this.bindingGroup.bind();

    ///// PARA CAMBIAR EL ANCHO DE LAS COLUMNAS
    javax.swing.table.TableColumn col = null;
    col = jtblXiiiSueldo.getColumnModel().getColumn(0);
    col.setPreferredWidth(100);
    col = jtblXiiiSueldo.getColumnModel().getColumn(1);
    col.setPreferredWidth(50);
    col = jtblXiiiSueldo.getColumnModel().getColumn(2);
    col.setPreferredWidth(100);
    col = jtblXiiiSueldo.getColumnModel().getColumn(3);
    col.setPreferredWidth(300);
    col = jtblXiiiSueldo.getColumnModel().getColumn(4);
    col.setPreferredWidth(100);
    col = jtblXiiiSueldo.getColumnModel().getColumn(5);
    col.setPreferredWidth(100);
    col = jtblXiiiSueldo.getColumnModel().getColumn(6);
    col.setPreferredWidth(100);
    col = jtblXiiiSueldo.getColumnModel().getColumn(7);
    col.setPreferredWidth(100);
    col = jtblXiiiSueldo.getColumnModel().getColumn(8);
    col.setPreferredWidth(100);
    col = jtblXiiiSueldo.getColumnModel().getColumn(9);
    col.setPreferredWidth(100);
    col = jtblXiiiSueldo.getColumnModel().getColumn(10);
    col.setPreferredWidth(100);
    col = jtblXiiiSueldo.getColumnModel().getColumn(11);
    col.setPreferredWidth(200);

    javax.swing.table.DefaultTableCellRenderer tcrCenter =
        new javax.swing.table.DefaultTableCellRenderer();
    javax.swing.table.DefaultTableCellRenderer tcrRight =
        new javax.swing.table.DefaultTableCellRenderer();
    tcrCenter.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jtblXiiiSueldo
        .getColumnModel()
        .getColumn(buscarColumna("Fecha Ingreso"))
        .setCellRenderer(tcrCenter);
    jtblXiiiSueldo.getColumnModel().getColumn(buscarColumna("Género")).setCellRenderer(tcrCenter);
    jtblXiiiSueldo
        .getColumnModel()
        .getColumn(buscarColumna("Código Ministerial"))
        .setCellRenderer(tcrCenter);
    tcrRight.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    jtblXiiiSueldo
        .getColumnModel()
        .getColumn(buscarColumna("Total Ingresos"))
        .setCellRenderer(tcrRight);
    jtblXiiiSueldo
        .getColumnModel()
        .getColumn(buscarColumna("Días Laborados"))
        .setCellRenderer(tcrRight);
    jtblXiiiSueldo
        .getColumnModel()
        .getColumn(buscarColumna("Xiii Sueldo"))
        .setCellRenderer(tcrRight);

    jtblXiiiSueldo.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
    // Metemos el modelo ordenable en la tabla.
    javax.swing.table.TableRowSorter modeloOrdenado =
        new javax.swing.table.TableRowSorter(jtblXiiiSueldo.getModel());
    jtblXiiiSueldo.setRowSorter(modeloOrdenado);
    jtblXiiiSueldo.setColumnSelectionAllowed(true);
  }
  /**
   * 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
Пример #14
0
  /**
   * 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
Пример #15
0
  /**
   * 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
Пример #16
0
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    cadastreObjectBean1 = createCadastreBean();
    cadastreObjectTypeListBean1 =
        new org.sola.clients.beans.referencedata.CadastreObjectTypeListBean();
    landUseTypeListBean1 = new org.sola.clients.beans.referencedata.LandUseTypeListBean();
    popUpAddresses = new javax.swing.JPopupMenu();
    menuAdd1 = new org.sola.clients.swing.common.menuitems.MenuAdd();
    menuEdit1 = new org.sola.clients.swing.common.menuitems.MenuEdit();
    menuRemove1 = new org.sola.clients.swing.common.menuitems.MenuRemove();
    lgaTypeListBean1 = new org.sola.clients.beans.referencedata.LgaTypeListBean();
    zoneTypeListBean1 = new org.sola.clients.beans.referencedata.ZoneTypeListBean();
    jPanel1 = new javax.swing.JPanel();
    jPanel9 = new javax.swing.JPanel();
    jLabel3 = new javax.swing.JLabel();
    txtPlot = new javax.swing.JTextField();
    jPanel5 = new javax.swing.JPanel();
    jLabel9 = new javax.swing.JLabel();
    txtParcelSurveyRef = new javax.swing.JTextField();
    jPanel8 = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    txtBlock = new javax.swing.JTextField();
    jPanel4 = new javax.swing.JPanel();
    jLabel10 = new javax.swing.JLabel();
    cbxParcelEstateType = new javax.swing.JComboBox();
    jPanel7 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    txtArea = new javax.swing.JFormattedTextField();
    jPanel6 = new javax.swing.JPanel();
    labLandUse = new javax.swing.JLabel();
    cbxLandUse = new javax.swing.JComboBox();
    jPanel11 = new javax.swing.JPanel();
    jLabel4 = new javax.swing.JLabel();
    jComboBox1 = new javax.swing.JComboBox();
    jPanel13 = new javax.swing.JPanel();
    jLabel6 = new javax.swing.JLabel();
    jTextField3 = new javax.swing.JTextField();
    jPanel2 = new javax.swing.JPanel();
    jLabel17 = new javax.swing.JLabel();
    txtParcelFirstPart = new javax.swing.JTextField();
    jPanel3 = new javax.swing.JPanel();
    jLabel7 = new javax.swing.JLabel();
    txtParcelLastPart = new javax.swing.JTextField();
    jPanel12 = new javax.swing.JPanel();
    jPanel14 = new javax.swing.JPanel();
    jToolBar1 = new javax.swing.JToolBar();
    btnAdd1 = new org.sola.clients.swing.common.buttons.BtnAdd();
    btnEdit1 = new org.sola.clients.swing.common.buttons.BtnEdit();
    btnRemove1 = new org.sola.clients.swing.common.buttons.BtnRemove();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTableWithDefaultStyles1 = new org.sola.clients.swing.common.controls.JTableWithDefaultStyles();
    groupPanel1 = new org.sola.clients.swing.ui.GroupPanel();

    java.util.ResourceBundle bundle =
        java.util.ResourceBundle.getBundle("org/sola/clients/swing/ui/cadastre/Bundle"); // NOI18N
    popUpAddresses.setName(bundle.getString("ParcelPanel.popUpAddresses.name")); // NOI18N

    menuAdd1.setName(bundle.getString("ParcelPanel.menuAdd1.name")); // NOI18N
    menuAdd1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuAdd1ActionPerformed(evt);
          }
        });
    popUpAddresses.add(menuAdd1);

    menuEdit1.setName(bundle.getString("ParcelPanel.menuEdit1.name")); // NOI18N
    menuEdit1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuEdit1ActionPerformed(evt);
          }
        });
    popUpAddresses.add(menuEdit1);

    menuRemove1.setName(bundle.getString("ParcelPanel.menuRemove1.name")); // NOI18N
    menuRemove1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuRemove1ActionPerformed(evt);
          }
        });
    popUpAddresses.add(menuRemove1);

    setName("Form"); // NOI18N

    jPanel1.setName(bundle.getString("ParcelPanel.jPanel1.name")); // NOI18N
    jPanel1.setLayout(new java.awt.GridLayout(3, 3, 15, 15));

    jPanel9.setName("jPanel9"); // NOI18N

    jLabel3.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N
    jLabel3.setText(bundle.getString("ParcelPanel.jLabel3.text")); // NOI18N
    jLabel3.setName("jLabel3"); // NOI18N

    txtPlot.setText(bundle.getString("ParcelPanel.txtPlot.text")); // NOI18N
    txtPlot.setName("txtPlot"); // NOI18N

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectBean1,
            org.jdesktop.beansbinding.ELProperty.create("${plotNum}"),
            txtPlot,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel9Layout = new org.jdesktop.layout.GroupLayout(jPanel9);
    jPanel9.setLayout(jPanel9Layout);
    jPanel9Layout.setHorizontalGroup(
        jPanel9Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(txtPlot)
            .add(
                jLabel3,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));
    jPanel9Layout.setVerticalGroup(
        jPanel9Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel9Layout
                    .createSequentialGroup()
                    .add(jLabel3)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        txtPlot,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(0, 18, Short.MAX_VALUE)));

    jPanel1.add(jPanel9);

    jPanel5.setName(bundle.getString("ParcelPanel.jPanel5.name")); // NOI18N

    jLabel9.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N
    jLabel9.setText(bundle.getString("ParcelPanel.jLabel9.text")); // NOI18N
    jLabel9.setName("jLabel9"); // NOI18N

    txtParcelSurveyRef.setName("txtParcelSurveyRef"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectBean1,
            org.jdesktop.beansbinding.ELProperty.create("${sourceReference}"),
            txtParcelSurveyRef,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
        jPanel5Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(txtParcelSurveyRef)
            .add(
                jLabel9,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));
    jPanel5Layout.setVerticalGroup(
        jPanel5Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel5Layout
                    .createSequentialGroup()
                    .add(jLabel9)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        txtParcelSurveyRef,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)));

    jPanel1.add(jPanel5);

    jPanel8.setName("jPanel8"); // NOI18N

    jLabel2.setText(bundle.getString("ParcelPanel.jLabel2.text")); // NOI18N
    jLabel2.setName("jLabel2"); // NOI18N

    txtBlock.setName("txtBlock"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectBean1,
            org.jdesktop.beansbinding.ELProperty.create("${block}"),
            txtBlock,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel8Layout = new org.jdesktop.layout.GroupLayout(jPanel8);
    jPanel8.setLayout(jPanel8Layout);
    jPanel8Layout.setHorizontalGroup(
        jPanel8Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(txtBlock, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
            .add(
                jLabel2,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));
    jPanel8Layout.setVerticalGroup(
        jPanel8Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel8Layout
                    .createSequentialGroup()
                    .add(jLabel2)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        txtBlock,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(0, 18, Short.MAX_VALUE)));

    jPanel1.add(jPanel8);

    jPanel4.setName(bundle.getString("ParcelPanel.jPanel4.name")); // NOI18N

    jLabel10.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N
    jLabel10.setText(bundle.getString("ParcelPanel.jLabel10.text")); // NOI18N
    jLabel10.setName("jLabel10"); // NOI18N

    cbxParcelEstateType.setName("cbxParcelEstateType"); // NOI18N
    cbxParcelEstateType.setRenderer(new SimpleComboBoxRenderer("getDisplayValue"));

    org.jdesktop.beansbinding.ELProperty eLProperty =
        org.jdesktop.beansbinding.ELProperty.create("${cadastreObjectTypeList}");
    org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding =
        org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectTypeListBean1,
            eLProperty,
            cbxParcelEstateType);
    bindingGroup.addBinding(jComboBoxBinding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectBean1,
            org.jdesktop.beansbinding.ELProperty.create("${cadastreObjectType}"),
            cbxParcelEstateType,
            org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
        jPanel4Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup().add(jLabel10).add(0, 88, Short.MAX_VALUE))
            .add(
                cbxParcelEstateType,
                0,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));
    jPanel4Layout.setVerticalGroup(
        jPanel4Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel4Layout
                    .createSequentialGroup()
                    .add(jLabel10)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        cbxParcelEstateType,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(0, 0, Short.MAX_VALUE)));

    jPanel1.add(jPanel4);

    jPanel7.setName(bundle.getString("ParcelPanel.jPanel7.name")); // NOI18N

    jLabel1.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N
    jLabel1.setText(bundle.getString("ParcelPanel.jLabel1.text")); // NOI18N
    jLabel1.setName(bundle.getString("ParcelPanel.jLabel1.name")); // NOI18N

    txtArea.setFormatterFactory(FormattersFactory.getInstance().getDecimalFormatterFactory());
    txtArea.setText(bundle.getString("ParcelPanel.txtArea.text")); // NOI18N
    txtArea.setName(bundle.getString("ParcelPanel.txtArea.name")); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectBean1,
            org.jdesktop.beansbinding.ELProperty.create("${officialAreaSize}"),
            txtArea,
            org.jdesktop.beansbinding.BeanProperty.create("value"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel7Layout = new org.jdesktop.layout.GroupLayout(jPanel7);
    jPanel7.setLayout(jPanel7Layout);
    jPanel7Layout.setHorizontalGroup(
        jPanel7Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel7Layout
                    .createSequentialGroup()
                    .add(jLabel1)
                    .addContainerGap(64, Short.MAX_VALUE))
            .add(txtArea));
    jPanel7Layout.setVerticalGroup(
        jPanel7Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel7Layout
                    .createSequentialGroup()
                    .add(jLabel1)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        txtArea,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)));

    jPanel1.add(jPanel7);

    jPanel6.setName(bundle.getString("ParcelPanel.jPanel6.name")); // NOI18N

    labLandUse.setText(bundle.getString("ParcelPanel.labLandUse.text")); // NOI18N
    labLandUse.setName(bundle.getString("ParcelPanel.labLandUse.name")); // NOI18N

    cbxLandUse.setName(bundle.getString("ParcelPanel.cbxLandUse.name")); // NOI18N

    eLProperty = org.jdesktop.beansbinding.ELProperty.create("${landUseTypeList}");
    jComboBoxBinding =
        org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            landUseTypeListBean1,
            eLProperty,
            cbxLandUse);
    bindingGroup.addBinding(jComboBoxBinding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectBean1,
            org.jdesktop.beansbinding.ELProperty.create("${landUseType}"),
            cbxLandUse,
            org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel6Layout = new org.jdesktop.layout.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(
        jPanel6Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel6Layout.createSequentialGroup().add(labLandUse).add(0, 82, Short.MAX_VALUE))
            .add(cbxLandUse, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
    jPanel6Layout.setVerticalGroup(
        jPanel6Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel6Layout
                    .createSequentialGroup()
                    .add(labLandUse)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        cbxLandUse,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(0, 0, Short.MAX_VALUE)));

    jPanel1.add(jPanel6);

    jPanel11.setName("jPanel11"); // NOI18N

    jLabel4.setText(bundle.getString("ParcelPanel.jLabel4.text")); // NOI18N
    jLabel4.setName("jLabel4"); // NOI18N

    jComboBox1.setName("jComboBox1"); // NOI18N

    eLProperty = org.jdesktop.beansbinding.ELProperty.create("${lgaTypeList}");
    jComboBoxBinding =
        org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            lgaTypeListBean1,
            eLProperty,
            jComboBox1);
    bindingGroup.addBinding(jComboBoxBinding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            lgaTypeListBean1,
            org.jdesktop.beansbinding.ELProperty.create("${selectedLgaType}"),
            jComboBox1,
            org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel11Layout = new org.jdesktop.layout.GroupLayout(jPanel11);
    jPanel11.setLayout(jPanel11Layout);
    jPanel11Layout.setHorizontalGroup(
        jPanel11Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel11Layout.createSequentialGroup().add(jLabel4).add(0, 0, Short.MAX_VALUE))
            .add(jComboBox1, 0, 126, Short.MAX_VALUE));
    jPanel11Layout.setVerticalGroup(
        jPanel11Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel11Layout
                    .createSequentialGroup()
                    .add(jLabel4)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jComboBox1,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(0, 18, Short.MAX_VALUE)));

    jPanel1.add(jPanel11);

    jPanel13.setName("jPanel13"); // NOI18N

    jLabel6.setText(bundle.getString("ParcelPanel.jLabel6.text")); // NOI18N
    jLabel6.setName("jLabel6"); // NOI18N

    jTextField3.setName("jTextField3"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectBean1,
            org.jdesktop.beansbinding.ELProperty.create("${intellMapSheet}"),
            jTextField3,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel13Layout = new org.jdesktop.layout.GroupLayout(jPanel13);
    jPanel13.setLayout(jPanel13Layout);
    jPanel13Layout.setHorizontalGroup(
        jPanel13Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel13Layout.createSequentialGroup().add(jLabel6).add(0, 59, Short.MAX_VALUE))
            .add(jTextField3));
    jPanel13Layout.setVerticalGroup(
        jPanel13Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel13Layout
                    .createSequentialGroup()
                    .add(jLabel6)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jTextField3,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(0, 18, Short.MAX_VALUE)));

    jPanel1.add(jPanel13);

    jPanel2.setName(bundle.getString("ParcelPanel.jPanel2.name")); // NOI18N

    jLabel17.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N
    jLabel17.setText(bundle.getString("ParcelPanel.jLabel17.text")); // NOI18N
    jLabel17.setName("jLabel17"); // NOI18N

    txtParcelFirstPart.setEditable(false);
    txtParcelFirstPart.setName("txtParcelFirstPart"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectBean1,
            org.jdesktop.beansbinding.ELProperty.create("${nameFirstpart}"),
            txtParcelFirstPart,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
        jPanel2Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup().add(jLabel17).add(0, 68, Short.MAX_VALUE))
            .add(txtParcelFirstPart));
    jPanel2Layout.setVerticalGroup(
        jPanel2Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel2Layout
                    .createSequentialGroup()
                    .add(jLabel17)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        txtParcelFirstPart,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(0, 0, Short.MAX_VALUE)));

    jPanel1.add(jPanel2);

    jPanel3.setName(bundle.getString("ParcelPanel.jPanel3.name")); // NOI18N

    jLabel7.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N
    jLabel7.setText(bundle.getString("ParcelPanel.jLabel7.text")); // NOI18N
    jLabel7.setName("jLabel7"); // NOI18N

    txtParcelLastPart.setEditable(false);
    txtParcelLastPart.setName("txtParcelLastPart"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectBean1,
            org.jdesktop.beansbinding.ELProperty.create("${nameLastpart}"),
            txtParcelLastPart,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
        jPanel3Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup().add(jLabel7).add(0, 69, Short.MAX_VALUE))
            .add(txtParcelLastPart));
    jPanel3Layout.setVerticalGroup(
        jPanel3Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel3Layout
                    .createSequentialGroup()
                    .add(jLabel7)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        txtParcelLastPart,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(0, 0, Short.MAX_VALUE)));

    jPanel1.add(jPanel3);

    jPanel12.setName("jPanel12"); // NOI18N

    org.jdesktop.layout.GroupLayout jPanel12Layout = new org.jdesktop.layout.GroupLayout(jPanel12);
    jPanel12.setLayout(jPanel12Layout);
    jPanel12Layout.setHorizontalGroup(
        jPanel12Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 126, Short.MAX_VALUE));
    jPanel12Layout.setVerticalGroup(
        jPanel12Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 58, Short.MAX_VALUE));

    jPanel1.add(jPanel12);

    jPanel14.setName("jPanel14"); // NOI18N

    org.jdesktop.layout.GroupLayout jPanel14Layout = new org.jdesktop.layout.GroupLayout(jPanel14);
    jPanel14.setLayout(jPanel14Layout);
    jPanel14Layout.setHorizontalGroup(
        jPanel14Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 126, Short.MAX_VALUE));
    jPanel14Layout.setVerticalGroup(
        jPanel14Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 58, Short.MAX_VALUE));

    jPanel1.add(jPanel14);

    jToolBar1.setFloatable(false);
    jToolBar1.setRollover(true);
    jToolBar1.setName(bundle.getString("ParcelPanel.jToolBar1.name")); // NOI18N

    btnAdd1.setName(bundle.getString("ParcelPanel.btnAdd1.name")); // NOI18N
    btnAdd1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAdd1ActionPerformed(evt);
          }
        });
    jToolBar1.add(btnAdd1);

    btnEdit1.setName(bundle.getString("ParcelPanel.btnEdit1.name")); // NOI18N
    btnEdit1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnEdit1ActionPerformed(evt);
          }
        });
    jToolBar1.add(btnEdit1);

    btnRemove1.setName(bundle.getString("ParcelPanel.btnRemove1.name")); // NOI18N
    btnRemove1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnRemove1ActionPerformed(evt);
          }
        });
    jToolBar1.add(btnRemove1);

    jScrollPane1.setName(bundle.getString("ParcelPanel.jScrollPane1.name")); // NOI18N

    jTableWithDefaultStyles1.setName(
        bundle.getString("ParcelPanel.jTableWithDefaultStyles1.name")); // NOI18N

    eLProperty = org.jdesktop.beansbinding.ELProperty.create("${addressFilteredList}");
    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectBean1,
            eLProperty,
            jTableWithDefaultStyles1);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${description}"));
    columnBinding.setColumnName("Description");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectBean1,
            org.jdesktop.beansbinding.ELProperty.create("${selectedAddress}"),
            jTableWithDefaultStyles1,
            org.jdesktop.beansbinding.BeanProperty.create("selectedElement"));
    bindingGroup.addBinding(binding);

    jScrollPane1.setViewportView(jTableWithDefaultStyles1);
    if (jTableWithDefaultStyles1.getColumnModel().getColumnCount() > 0) {
      jTableWithDefaultStyles1
          .getColumnModel()
          .getColumn(0)
          .setHeaderValue(
              bundle.getString(
                  "ParcelPanel.jTableWithDefaultStyles1.columnModel.title0_1")); // NOI18N
      jTableWithDefaultStyles1
          .getColumnModel()
          .getColumn(0)
          .setCellRenderer(new org.sola.clients.swing.ui.renderers.TableCellTextAreaRenderer());
    }

    groupPanel1.setName(bundle.getString("ParcelPanel.groupPanel1.name")); // NOI18N
    groupPanel1.setTitleText(bundle.getString("ParcelPanel.groupPanel1.titleText")); // NOI18N

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel1,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE)
            .add(
                jToolBar1,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE)
            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
            .add(groupPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                layout
                    .createSequentialGroup()
                    .add(
                        jPanel1,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        205,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        groupPanel1,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jToolBar1,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        25,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jScrollPane1,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        173,
                        Short.MAX_VALUE)));

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
Пример #17
0
  /**
   * 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
Пример #18
0
  /**
   * 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
Пример #19
0
  /**
   * 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
Пример #20
0
  private void llenarjTable() throws Exception {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
    bindingGroup.bind();

    this.carBBPagosCobrosConsulta.setCarFunPagosDetalleTOs(
        shrimp.cartera.delegate.CarDelegate.getInstance()
            .getCarFunPagosDetalleTO(
                sisUsuarioEmpresaTO.getEmpCodigo(),
                codigoSector,
                fechaDesde,
                fechaHasta,
                proveedorId,
                null));
    this.bindingGroup.bind(); // consigue los datos
    this.jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_ONCE,
            this.carBBPagosCobrosConsulta.getCarFunPagosDetalleTOs(),
            jtable);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${pagNumeroSistema}"));
    columnBinding.setColumnName("Número");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding1 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${pagFecha}")); // ${nombreAtributo}
    columnBinding1.setColumnName("Fecha");
    columnBinding1.setColumnClass(String.class);
    columnBinding1.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding2 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${pagProveedor}"));
    columnBinding2.setColumnName("Proveedor");
    columnBinding2.setColumnClass(String.class);
    columnBinding2.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding3 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${pagValor}"));
    columnBinding3.setColumnName("Valor");
    columnBinding3.setColumnClass(java.math.BigDecimal.class);
    columnBinding3.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding4 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${pagObservaciones}"));
    columnBinding4.setColumnName("Observaciones");
    columnBinding4.setColumnClass(String.class);
    columnBinding4.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding5 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${pagPendiente}"));
    columnBinding5.setColumnName("Pendiente");
    columnBinding5.setColumnClass(Boolean.class);
    columnBinding5.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding6 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${pagAnulado}"));
    columnBinding6.setColumnName("Anulado");
    columnBinding6.setColumnClass(Boolean.class);
    columnBinding6.setEditable(false);

    this.bindingGroup.addBinding(this.jTableBinding);
    this.bindingGroup.bind();

    jtable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
    // Metemos el modelo ordenable en la tabla.
    javax.swing.table.TableRowSorter modeloOrdenado =
        new javax.swing.table.TableRowSorter(jtable.getModel());
    jtable.setRowSorter(modeloOrdenado);

    ///// PARA CAMBIAR EL ANCHO DE LAS COLUMNAS
    javax.swing.table.TableColumn col = null;
    col = jtable.getColumnModel().getColumn(0);
    col.setPreferredWidth(200);
    col = jtable.getColumnModel().getColumn(1);
    col.setPreferredWidth(100);
    col = jtable.getColumnModel().getColumn(2);
    col.setPreferredWidth(200);
    col = jtable.getColumnModel().getColumn(3);
    col.setPreferredWidth(100);
    col = jtable.getColumnModel().getColumn(4);
    col.setPreferredWidth(200);
    col = jtable.getColumnModel().getColumn(5);
    col.setPreferredWidth(80);
    col = jtable.getColumnModel().getColumn(6);
    col.setPreferredWidth(80);
  }
Пример #21
0
  /**
   * Este método é invocado pelo construtor e seu objetivo é inicializar o form. WARNING: Não
   * modifique este código. O seu conteúdo é automaticamente regerado pelo editor visual do
   * formulário.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    listTipoContrato = ObservableCollections.observableList(new TipoContratoDao().listAll());
    tipoContratoBean = new br.com.etec.model.TipoContrato();
    paneltitulo = new javax.swing.JPanel();
    lblTitulo = new javax.swing.JLabel();
    panelTable = new javax.swing.JPanel();
    scrollTable = new javax.swing.JScrollPane();
    tbTipoContrato = new javax.swing.JTable();
    tbTipoContrato
        .getSelectionModel()
        .addListSelectionListener(
            new ListSelectionListener() {
              @Override
              public void valueChanged(ListSelectionEvent evt) {
                if (tbTipoContrato.getSelectedRow() != -1) {
                  tipoContratoBean = listTipoContrato.get(tbTipoContrato.getSelectedRow());
                  btnAlterar.setEnabled(Boolean.TRUE);
                  btnExcluir.setEnabled(Boolean.TRUE);
                } else {
                  tipoContratoBean = null;
                  btnAlterar.setEnabled(Boolean.FALSE);
                  btnExcluir.setEnabled(Boolean.FALSE);
                }
              }
            });
    panelDados = new javax.swing.JPanel();
    btnPrimeiro = new javax.swing.JButton();
    btnAnterior = new javax.swing.JButton();
    btnProximo = new javax.swing.JButton();
    btnUltimo = new javax.swing.JButton();
    jScrollPane2 = new javax.swing.JScrollPane();
    lblRecordInfo = new javax.swing.JTextArea();
    lblId = new javax.swing.JLabel();
    txtId = new javax.swing.JTextField();
    lblNome = new javax.swing.JLabel();
    btnAlterar = new javax.swing.JButton();
    btnSalvar = new javax.swing.JButton();
    btnCancelar = new javax.swing.JButton();
    txtNome = new javax.swing.JTextField();
    btnIncluir = new javax.swing.JButton();
    btnExcluir = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setResizable(false);
    getContentPane().setLayout(new java.awt.GridBagLayout());

    paneltitulo.setPreferredSize(new java.awt.Dimension(1198, 40));
    paneltitulo.setLayout(new java.awt.GridBagLayout());

    lblTitulo.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    lblTitulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    lblTitulo.setText("Tipos de Contrato");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.insets = new java.awt.Insets(20, 20, 0, 20);
    paneltitulo.add(lblTitulo, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.insets = new java.awt.Insets(10, 20, 10, 20);
    getContentPane().add(paneltitulo, gridBagConstraints);

    panelTable.setLayout(new java.awt.GridBagLayout());

    tbTipoContrato.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);

    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            listTipoContrato,
            tbTipoContrato);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}"));
    columnBinding.setColumnName("Id");
    columnBinding.setColumnClass(Integer.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${nome}"));
    columnBinding.setColumnName("Nome");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    scrollTable.setViewportView(tbTipoContrato);
    tbTipoContrato
        .getColumnModel()
        .getSelectionModel()
        .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    tbTipoContrato.getColumnModel().getColumn(0).setResizable(false);
    tbTipoContrato.getColumnModel().getColumn(0).setPreferredWidth(50);
    tbTipoContrato.getColumnModel().getColumn(1).setResizable(false);
    tbTipoContrato.getColumnModel().getColumn(1).setPreferredWidth(250);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.ipady = 160;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    panelTable.add(scrollTable, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = new java.awt.Insets(10, 20, 10, 20);
    getContentPane().add(panelTable, gridBagConstraints);

    panelDados.setLayout(new java.awt.GridBagLayout());

    btnPrimeiro.setText("|<<");
    btnPrimeiro.setToolTipText("Primeiro Registro");
    btnPrimeiro.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnPrimeiroActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.ipadx = 10;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(11, 38, 0, 0);
    panelDados.add(btnPrimeiro, gridBagConstraints);

    btnAnterior.setText("<");
    btnAnterior.setToolTipText("Registro Anterior");
    btnAnterior.setMaximumSize(new java.awt.Dimension(53, 23));
    btnAnterior.setMinimumSize(new java.awt.Dimension(53, 23));
    btnAnterior.setPreferredSize(new java.awt.Dimension(53, 23));
    btnAnterior.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAnteriorActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = 7;
    gridBagConstraints.ipadx = 10;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(11, 6, 0, 0);
    panelDados.add(btnAnterior, gridBagConstraints);

    btnProximo.setText(">");
    btnProximo.setToolTipText("Próximo Registro");
    btnProximo.setMaximumSize(new java.awt.Dimension(53, 23));
    btnProximo.setMinimumSize(new java.awt.Dimension(53, 23));
    btnProximo.setPreferredSize(new java.awt.Dimension(53, 23));
    btnProximo.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnProximoActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 13;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = 11;
    gridBagConstraints.ipadx = 10;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(11, 6, 0, 0);
    panelDados.add(btnProximo, gridBagConstraints);

    btnUltimo.setText(">>|");
    btnUltimo.setToolTipText("Último Registro");
    btnUltimo.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnUltimoActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 32;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = 65;
    gridBagConstraints.ipadx = 12;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(11, 6, 0, 0);
    panelDados.add(btnUltimo, gridBagConstraints);

    lblRecordInfo.setEditable(false);
    lblRecordInfo.setBackground(javax.swing.UIManager.getDefaults().getColor("Label.background"));
    lblRecordInfo.setColumns(20);
    lblRecordInfo.setFont(new java.awt.Font("Tahoma", 1, 10)); // NOI18N
    lblRecordInfo.setLineWrap(true);
    lblRecordInfo.setRows(2);
    lblRecordInfo.setDisabledTextColor(new java.awt.Color(0, 0, 0));
    lblRecordInfo.setEnabled(false);
    jScrollPane2.setViewportView(lblRecordInfo);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.gridwidth = 98;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.ipadx = 311;
    gridBagConstraints.ipady = 20;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(6, 10, 0, 10);
    panelDados.add(jScrollPane2, gridBagConstraints);

    lblId.setText("Id:");
    lblId.setToolTipText("");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(13, 77, 0, 0);
    panelDados.add(lblId, gridBagConstraints);

    txtId.setDisabledTextColor(new java.awt.Color(0, 0, 0));
    txtId.setEnabled(false);

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            tbTipoContrato,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.id}"),
            txtId,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = 55;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.ipadx = 178;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(10, 4, 0, 0);
    panelDados.add(txtId, gridBagConstraints);

    lblNome.setText("Nome:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 60, 0, 0);
    panelDados.add(lblNome, gridBagConstraints);

    btnAlterar.setText("Alterar");
    btnAlterar.setActionCommand("ListarCargoView.alterar");
    btnAlterar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAlterarActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 4;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = 10;
    gridBagConstraints.ipadx = 18;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(16, 10, 0, 0);
    panelDados.add(btnAlterar, gridBagConstraints);

    btnSalvar.setText("Salvar");
    btnSalvar.setActionCommand("ListarCargoView.salvar");
    btnSalvar.setEnabled(false);
    btnSalvar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSalvarActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.gridwidth = 5;
    gridBagConstraints.ipadx = 10;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 88, 0, 0);
    panelDados.add(btnSalvar, gridBagConstraints);

    btnCancelar.setText("Cancelar");
    btnCancelar.setActionCommand("ListarCargoView.cancelar");
    btnCancelar.setEnabled(false);
    btnCancelar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnCancelarActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 8;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.gridwidth = 25;
    gridBagConstraints.ipadx = 10;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 6, 0, 0);
    panelDados.add(btnCancelar, gridBagConstraints);

    txtNome.setDisabledTextColor(new java.awt.Color(0, 0, 0));

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            tbTipoContrato,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.nome}"),
            txtNome,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = 97;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.ipadx = 243;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 10);
    panelDados.add(txtNome, gridBagConstraints);

    btnIncluir.setText("Incluir");
    btnIncluir.setActionCommand("incluir");
    btnIncluir.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnIncluirActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.ipadx = 22;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(16, 38, 0, 0);
    panelDados.add(btnIncluir, gridBagConstraints);

    btnExcluir.setText("Excluir");
    btnExcluir.setActionCommand("ListarCargoView.excluir");
    btnExcluir.setPreferredSize(new java.awt.Dimension(65, 23));
    btnExcluir.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnExcluirActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 23;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = 64;
    gridBagConstraints.ipadx = 20;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(16, 10, 0, 0);
    panelDados.add(btnExcluir, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.insets = new java.awt.Insets(10, 20, 20, 20);
    getContentPane().add(panelDados, gridBagConstraints);

    bindingGroup.bind();

    java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
    setBounds((screenSize.width - 610) / 2, (screenSize.height - 576) / 2, 610, 576);
  } // </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
Пример #23
0
  /**
   * 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
Пример #24
0
  /**
   * 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();

    cadastreObjectListBean = createBean();
    jScrollPane1 = new javax.swing.JScrollPane();
    tableCadastreObject = new javax.swing.JTable();
    cmdRemove = new javax.swing.JButton();

    setPreferredSize(new java.awt.Dimension(300, 180));

    org.jdesktop.beansbinding.ELProperty eLProperty =
        org.jdesktop.beansbinding.ELProperty.create("${beanList}");
    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectListBean,
            eLProperty,
            tableCadastreObject);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${nameFirstpart}"));
    columnBinding.setColumnName("Name Firstpart");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${nameLastpart}"));
    columnBinding.setColumnName("Name Lastpart");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${officialArea}"));
    columnBinding.setColumnName("Official Area");
    columnBinding.setColumnClass(Double.class);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            cadastreObjectListBean,
            org.jdesktop.beansbinding.ELProperty.create("${selectedBean}"),
            tableCadastreObject,
            org.jdesktop.beansbinding.BeanProperty.create("selectedElement"));
    bindingGroup.addBinding(binding);

    jScrollPane1.setViewportView(tableCadastreObject);
    java.util.ResourceBundle bundle =
        java.util.ResourceBundle.getBundle(
            "org/sola/clients/swing/gis/ui/control/Bundle"); // NOI18N
    tableCadastreObject
        .getColumnModel()
        .getColumn(0)
        .setHeaderValue(
            bundle.getString(
                "CadastreObjectListPanel.tableCadastreObject.columnModel.title0")); // NOI18N
    tableCadastreObject
        .getColumnModel()
        .getColumn(1)
        .setHeaderValue(
            bundle.getString(
                "CadastreObjectListPanel.tableCadastreObject.columnModel.title1")); // NOI18N
    tableCadastreObject
        .getColumnModel()
        .getColumn(2)
        .setHeaderValue(
            bundle.getString(
                "CadastreObjectListPanel.tableCadastreObject.columnModel.title2")); // NOI18N

    cmdRemove.setText(bundle.getString("CadastreObjectListPanel.cmdRemove.text")); // NOI18N
    cmdRemove.setEnabled(false);
    cmdRemove.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            cmdRemoveActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                0,
                                Short.MAX_VALUE)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        204,
                                        Short.MAX_VALUE)
                                    .addComponent(cmdRemove)))
                    .addGap(15, 15, 15)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addGap(16, 16, 16)
                    .addComponent(cmdRemove)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE)
                    .addContainerGap()));

    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();
    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();
  }
Пример #26
0
  public void llenarjTable() throws Exception {
    //        this.bindingGroup.bind();//consigue los datos
    this.jTableBinding =
        SwingBindings.createJTableBinding(
            AutoBinding.UpdateStrategy.READ_ONCE,
            this.bbResumenCorrida1.getListaPrdListaResumenCorridaTO(),
            jtable);

    JTableBinding.ColumnBinding columnBinding =
        this.jTableBinding.addColumnBinding(ELProperty.create("${secCodigo}"));
    columnBinding.setColumnName("Sector");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);

    JTableBinding.ColumnBinding columnBinding1 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${pisNumero}"));
    columnBinding1.setColumnName("Piscina");
    columnBinding1.setColumnClass(String.class);
    columnBinding1.setEditable(false);

    JTableBinding.ColumnBinding columnBinding2 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcCorridaNumero}"));
    columnBinding2.setColumnName("Corrida");
    columnBinding2.setColumnClass(String.class);
    columnBinding2.setEditable(false);

    JTableBinding.ColumnBinding columnBinding3 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcHectareaje}"));
    columnBinding3.setColumnName("Has.");
    columnBinding3.setColumnClass(BigDecimal.class);
    columnBinding3.setEditable(false);

    JTableBinding.ColumnBinding columnBinding4 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcFechaSiembra}"));
    columnBinding4.setColumnName("Siembra");
    columnBinding4.setColumnClass(String.class);
    columnBinding4.setEditable(false);

    JTableBinding.ColumnBinding columnBinding5 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcFechaPesca}"));
    columnBinding5.setColumnName("Pesca");
    columnBinding5.setColumnClass(String.class);
    columnBinding5.setEditable(false);

    JTableBinding.ColumnBinding columnBinding6 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcEdad}"));
    columnBinding6.setColumnName("Edad");
    columnBinding6.setColumnClass(BigDecimal.class);
    columnBinding6.setEditable(false);

    JTableBinding.ColumnBinding columnBinding7 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcDiasMuertos}"));
    columnBinding7.setColumnName("Días Muertos");
    columnBinding7.setColumnClass(BigDecimal.class);
    columnBinding7.setEditable(false);

    JTableBinding.ColumnBinding columnBinding8 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcNumeroLarvas}"));
    columnBinding8.setColumnName("Larvas");
    columnBinding8.setColumnClass(BigDecimal.class);
    columnBinding8.setEditable(false);

    JTableBinding.ColumnBinding columnBinding9 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcDensidad}"));
    columnBinding9.setColumnName("Densidad");
    columnBinding9.setColumnClass(BigDecimal.class);
    columnBinding9.setEditable(false);

    JTableBinding.ColumnBinding columnBinding10 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcLaboratorio}"));
    columnBinding10.setColumnName("Laboratorio");
    columnBinding10.setColumnClass(String.class);
    columnBinding10.setEditable(false);

    JTableBinding.ColumnBinding columnBinding11 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcNauplio}"));
    columnBinding11.setColumnName("Nauplio");
    columnBinding11.setColumnClass(String.class);
    columnBinding11.setEditable(false);

    JTableBinding.ColumnBinding columnBinding12 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcLibrasBalanceados}"));
    columnBinding12.setColumnName("Balanceado");
    columnBinding12.setColumnClass(BigDecimal.class);
    columnBinding12.setEditable(false);

    JTableBinding.ColumnBinding columnBinding13 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcBiomasa}"));
    columnBinding13.setColumnName("Biomasa Proyectada");
    columnBinding13.setColumnClass(BigDecimal.class);
    columnBinding13.setEditable(false);

    JTableBinding.ColumnBinding columnBinding14 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcBiomasaReal}"));
    columnBinding14.setColumnName("Biomasa Real");
    columnBinding14.setColumnClass(BigDecimal.class);
    columnBinding14.setEditable(false);

    JTableBinding.ColumnBinding columnBinding15 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcConversion}"));
    columnBinding15.setColumnName("Conversión");
    columnBinding15.setColumnClass(BigDecimal.class);
    columnBinding15.setEditable(false);

    JTableBinding.ColumnBinding columnBinding16 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcTPromedio}"));
    columnBinding16.setColumnName("Peso");
    columnBinding16.setColumnClass(BigDecimal.class);
    columnBinding16.setEditable(false);

    JTableBinding.ColumnBinding columnBinding17 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcPesoIdeal}"));
    columnBinding17.setColumnName("Peso Ideal");
    columnBinding17.setColumnClass(BigDecimal.class);
    columnBinding17.setEditable(false);

    JTableBinding.ColumnBinding columnBinding18 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcSobrevivencia}"));
    columnBinding18.setColumnName("Sobrevivencia");
    columnBinding18.setColumnClass(String.class);
    columnBinding18.setEditable(false);

    JTableBinding.ColumnBinding columnBinding19 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcCosto}"));
    columnBinding19.setColumnName("Costo");
    columnBinding19.setColumnClass(BigDecimal.class);
    columnBinding19.setEditable(false);

    JTableBinding.ColumnBinding columnBinding20 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcDirecto}"));
    columnBinding20.setColumnName("Directo");
    columnBinding20.setColumnClass(BigDecimal.class);
    columnBinding20.setEditable(false);

    JTableBinding.ColumnBinding columnBinding21 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcIndirecto}"));
    columnBinding21.setColumnName("Indirecto");
    columnBinding21.setColumnClass(BigDecimal.class);
    columnBinding21.setEditable(false);

    JTableBinding.ColumnBinding columnBinding22 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcValorVenta}"));
    columnBinding22.setColumnName("Venta");
    columnBinding22.setColumnClass(BigDecimal.class);
    columnBinding22.setEditable(false);

    JTableBinding.ColumnBinding columnBinding23 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcResultado}"));
    columnBinding23.setColumnName("Resultado");
    columnBinding23.setColumnClass(BigDecimal.class);
    columnBinding23.setEditable(false);

    JTableBinding.ColumnBinding columnBinding24 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcCostoHectarea}"));
    columnBinding24.setColumnName("Costo Ha.");
    columnBinding24.setColumnClass(BigDecimal.class);
    columnBinding24.setEditable(false);

    JTableBinding.ColumnBinding columnBinding25 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcVentaHectarea}"));
    columnBinding25.setColumnName("Venta Ha.");
    columnBinding25.setColumnClass(BigDecimal.class);
    columnBinding25.setEditable(false);

    JTableBinding.ColumnBinding columnBinding26 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcResultadoHectarea}"));
    columnBinding26.setColumnName("Resultado Ha.");
    columnBinding26.setColumnClass(BigDecimal.class);
    columnBinding26.setEditable(false);

    JTableBinding.ColumnBinding columnBinding27 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcCostoLibra}"));
    columnBinding27.setColumnName("Costo Lb.");
    columnBinding27.setColumnClass(BigDecimal.class);
    columnBinding27.setEditable(false);

    JTableBinding.ColumnBinding columnBinding28 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcVentaLibra}"));
    columnBinding28.setColumnName("Venta Lb.");
    columnBinding28.setColumnClass(BigDecimal.class);
    columnBinding28.setEditable(false);

    JTableBinding.ColumnBinding columnBinding37 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcResultadoLibra}"));
    columnBinding37.setColumnName("Resultado Lb.");
    columnBinding37.setColumnClass(BigDecimal.class);
    columnBinding37.setEditable(false);

    JTableBinding.ColumnBinding columnBinding38 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcCostoDirectoDia}"));
    columnBinding38.setColumnName("Costo Dir. Día");
    columnBinding38.setColumnClass(BigDecimal.class);
    columnBinding38.setEditable(false);

    JTableBinding.ColumnBinding columnBinding39 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcCostoindirectoDia}"));
    columnBinding39.setColumnName("Costo Ind. Día");
    columnBinding39.setColumnClass(BigDecimal.class);
    columnBinding39.setEditable(false);

    JTableBinding.ColumnBinding columnBinding40 =
        this.jTableBinding.addColumnBinding(ELProperty.create("${rcCostoTotalDia}"));
    columnBinding40.setColumnName("Costo Ttl. Dia");
    columnBinding40.setColumnClass(BigDecimal.class);
    columnBinding40.setEditable(false);

    this.bindingGroup.addBinding(this.jTableBinding);
    this.bindingGroup.bind();

    jtable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    // Metemos el modelo ordenable en la tabla.
    TableRowSorter modeloOrdenado = new TableRowSorter(jtable.getModel());
    jtable.setRowSorter(modeloOrdenado);
  }
Пример #27
0
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    popupUsers = new javax.swing.JPopupMenu();
    menuAddUser = new javax.swing.JMenuItem();
    menuEditUser = new javax.swing.JMenuItem();
    menuSetPassword = new javax.swing.JMenuItem();
    menuRemoveUser = new javax.swing.JMenuItem();
    groupsList = new org.sola.clients.beans.security.GroupSummaryListBean();
    userSearchParams = new org.sola.clients.beans.security.UserSearchParamsBean();
    userSearchResultList = new org.sola.clients.beans.security.UserSearchAdvancedResultListBean();
    pnlHeader = new org.sola.clients.swing.ui.HeaderPanel();
    pnlSearchCriteria = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    txtUsername = new javax.swing.JTextField();
    jPanel3 = new javax.swing.JPanel();
    txtFirstName = new javax.swing.JTextField();
    jLabel1 = new javax.swing.JLabel();
    jPanel4 = new javax.swing.JPanel();
    jLabel3 = new javax.swing.JLabel();
    txtLastName = new javax.swing.JTextField();
    jPanel5 = new javax.swing.JPanel();
    jLabel4 = new javax.swing.JLabel();
    comboGroups = new javax.swing.JComboBox();
    jPanel1 = new javax.swing.JPanel();
    jLabel5 = new javax.swing.JLabel();
    btnSearch = new javax.swing.JButton();
    toolbarUsers = new javax.swing.JToolBar();
    btnAddUser = new javax.swing.JButton();
    btnEditUser = new javax.swing.JButton();
    btnSetPassword = new javax.swing.JButton();
    btnRemoveUser = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    tableUsers = new org.sola.clients.swing.common.controls.JTableWithDefaultStyles();

    popupUsers.setName("popupUsers"); // NOI18N

    menuAddUser.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/add.png"))); // NOI18N
    java.util.ResourceBundle bundle =
        java.util.ResourceBundle.getBundle(
            "org/sola/clients/swing/admin/security/Bundle"); // NOI18N
    menuAddUser.setText(bundle.getString("UsersManagementPanel.menuAddUser.text")); // NOI18N
    menuAddUser.setName("menuAddUser"); // NOI18N
    menuAddUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuAddUserActionPerformed(evt);
          }
        });
    popupUsers.add(menuAddUser);

    menuEditUser.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/pencil.png"))); // NOI18N
    menuEditUser.setText(bundle.getString("UsersManagementPanel.menuEditUser.text")); // NOI18N
    menuEditUser.setName("menuEditUser"); // NOI18N
    menuEditUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuEditUserActionPerformed(evt);
          }
        });
    popupUsers.add(menuEditUser);

    menuSetPassword.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/lock--pencil.png"))); // NOI18N
    menuSetPassword.setText(
        bundle.getString("UsersManagementPanel.menuSetPassword.text")); // NOI18N
    menuSetPassword.setName("menuSetPassword"); // NOI18N
    menuSetPassword.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuSetPasswordActionPerformed(evt);
          }
        });
    popupUsers.add(menuSetPassword);

    menuRemoveUser.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/remove.png"))); // NOI18N
    menuRemoveUser.setText(bundle.getString("UsersManagementPanel.menuRemoveUser.text")); // NOI18N
    menuRemoveUser.setName("menuRemoveUser"); // NOI18N
    menuRemoveUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuRemoveUserActionPerformed(evt);
          }
        });
    popupUsers.add(menuRemoveUser);

    setHeaderPanel(pnlHeader);
    setMinimumSize(new java.awt.Dimension(200, 200));

    pnlHeader.setName("pnlHeader"); // NOI18N
    pnlHeader.setTitleText(bundle.getString("UsersManagementPanel.pnlHeader.titleText")); // NOI18N

    pnlSearchCriteria.setName("pnlSearchCriteria"); // NOI18N
    pnlSearchCriteria.setLayout(new java.awt.GridLayout(1, 4, 15, 0));

    jPanel2.setName(bundle.getString("UsersManagementPanel.jPanel2.name")); // NOI18N

    jLabel2.setText(bundle.getString("UsersManagementPanel.jLabel2.text")); // NOI18N
    jLabel2.setName("jLabel2"); // NOI18N

    txtUsername.setName("txtUsername"); // NOI18N
    txtUsername.setNextFocusableComponent(txtFirstName);

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            userSearchParams,
            org.jdesktop.beansbinding.ELProperty.create("${userName}"),
            txtUsername,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel2Layout
                    .createSequentialGroup()
                    .addComponent(jLabel2)
                    .addGap(0, 53, Short.MAX_VALUE))
            .addComponent(txtUsername));
    jPanel2Layout.setVerticalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel2Layout
                    .createSequentialGroup()
                    .addComponent(jLabel2)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        txtUsername,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)));

    pnlSearchCriteria.add(jPanel2);

    jPanel3.setName(bundle.getString("UsersManagementPanel.jPanel3.name")); // NOI18N

    txtFirstName.setName("txtFirstName"); // NOI18N
    txtFirstName.setNextFocusableComponent(txtLastName);

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            userSearchParams,
            org.jdesktop.beansbinding.ELProperty.create("${firstName}"),
            txtFirstName,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    jLabel1.setText(bundle.getString("UsersManagementPanel.jLabel1.text")); // NOI18N
    jLabel1.setName("jLabel1"); // NOI18N

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel3Layout
                    .createSequentialGroup()
                    .addComponent(jLabel1)
                    .addGap(0, 51, Short.MAX_VALUE))
            .addComponent(txtFirstName));
    jPanel3Layout.setVerticalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel3Layout
                    .createSequentialGroup()
                    .addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        txtFirstName,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)));

    pnlSearchCriteria.add(jPanel3);

    jPanel4.setName(bundle.getString("UsersManagementPanel.jPanel4.name")); // NOI18N

    jLabel3.setText(bundle.getString("UsersManagementPanel.jLabel3.text")); // NOI18N
    jLabel3.setName("jLabel3"); // NOI18N

    txtLastName.setName("txtLastName"); // NOI18N
    txtLastName.setNextFocusableComponent(comboGroups);

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            userSearchParams,
            org.jdesktop.beansbinding.ELProperty.create("${lastName}"),
            txtLastName,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
        jPanel4Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel4Layout
                    .createSequentialGroup()
                    .addComponent(jLabel3)
                    .addGap(0, 52, Short.MAX_VALUE))
            .addComponent(txtLastName));
    jPanel4Layout.setVerticalGroup(
        jPanel4Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel4Layout
                    .createSequentialGroup()
                    .addComponent(jLabel3)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        txtLastName,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)));

    pnlSearchCriteria.add(jPanel4);

    jPanel5.setName(bundle.getString("UsersManagementPanel.jPanel5.name")); // NOI18N

    jLabel4.setText(bundle.getString("UsersManagementPanel.jLabel4.text")); // NOI18N
    jLabel4.setName("jLabel4"); // NOI18N

    comboGroups.setName("comboGroups"); // NOI18N
    comboGroups.setNextFocusableComponent(btnSearch);

    org.jdesktop.beansbinding.ELProperty eLProperty =
        org.jdesktop.beansbinding.ELProperty.create("${groupSummaryList}");
    org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding =
        org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            groupsList,
            eLProperty,
            comboGroups);
    bindingGroup.addBinding(jComboBoxBinding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            userSearchParams,
            org.jdesktop.beansbinding.ELProperty.create("${groupBean}"),
            comboGroups,
            org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
        jPanel5Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel5Layout
                    .createSequentialGroup()
                    .addComponent(jLabel4)
                    .addGap(0, 67, Short.MAX_VALUE))
            .addComponent(comboGroups, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
    jPanel5Layout.setVerticalGroup(
        jPanel5Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel5Layout
                    .createSequentialGroup()
                    .addComponent(jLabel4)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        comboGroups,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)));

    pnlSearchCriteria.add(jPanel5);

    jPanel1.setName(bundle.getString("UsersManagementPanel.jPanel1.name")); // NOI18N

    jLabel5.setText(bundle.getString("UsersManagementPanel.jLabel5.text")); // NOI18N
    jLabel5.setName(bundle.getString("UsersManagementPanel.jLabel5.name")); // NOI18N

    btnSearch.setText(bundle.getString("UsersManagementPanel.btnSearch.text")); // NOI18N
    btnSearch.setName("btnSearch"); // NOI18N
    btnSearch.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSearchActionPerformed(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()
                    .addComponent(jLabel5)
                    .addGap(0, 0, Short.MAX_VALUE))
            .addComponent(btnSearch, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addComponent(jLabel5)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(btnSearch)));

    toolbarUsers.setFloatable(false);
    toolbarUsers.setRollover(true);
    toolbarUsers.setName("toolbarUsers"); // NOI18N

    btnAddUser.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/add.png"))); // NOI18N
    btnAddUser.setText(bundle.getString("UsersManagementPanel.btnAddUser.text")); // NOI18N
    btnAddUser.setFocusable(false);
    btnAddUser.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnAddUser.setName("btnAddUser"); // NOI18N
    btnAddUser.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnAddUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAddUserActionPerformed(evt);
          }
        });
    toolbarUsers.add(btnAddUser);

    btnEditUser.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/pencil.png"))); // NOI18N
    btnEditUser.setText(bundle.getString("UsersManagementPanel.btnEditUser.text")); // NOI18N
    btnEditUser.setFocusable(false);
    btnEditUser.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnEditUser.setName("btnEditUser"); // NOI18N
    btnEditUser.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnEditUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnEditUserActionPerformed(evt);
          }
        });
    toolbarUsers.add(btnEditUser);

    btnSetPassword.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/lock--pencil.png"))); // NOI18N
    btnSetPassword.setText(bundle.getString("UsersManagementPanel.btnSetPassword.text")); // NOI18N
    btnSetPassword.setFocusable(false);
    btnSetPassword.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnSetPassword.setName("btnSetPassword"); // NOI18N
    btnSetPassword.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnSetPassword.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSetPasswordActionPerformed(evt);
          }
        });
    toolbarUsers.add(btnSetPassword);

    btnRemoveUser.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/remove.png"))); // NOI18N
    btnRemoveUser.setText(bundle.getString("UsersManagementPanel.btnRemoveUser.text")); // NOI18N
    btnRemoveUser.setFocusable(false);
    btnRemoveUser.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnRemoveUser.setName("btnRemoveUser"); // NOI18N
    btnRemoveUser.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnRemoveUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnRemoveUserActionPerformed(evt);
          }
        });
    toolbarUsers.add(btnRemoveUser);

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    tableUsers.setComponentPopupMenu(popupUsers);
    tableUsers.setName("tableUsers"); // NOI18N

    eLProperty = org.jdesktop.beansbinding.ELProperty.create("${usersList}");
    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            userSearchResultList,
            eLProperty,
            tableUsers);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${userName}"));
    columnBinding.setColumnName("Username");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${firstName}"));
    columnBinding.setColumnName("First name");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${lastName}"));
    columnBinding.setColumnName("Last name");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${description}"));
    columnBinding.setColumnName("Description");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${groupsList}"));
    columnBinding.setColumnName("Groups");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${active}"));
    columnBinding.setColumnName("Active");
    columnBinding.setColumnClass(Boolean.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            userSearchResultList,
            org.jdesktop.beansbinding.ELProperty.create("${selectedUser}"),
            tableUsers,
            org.jdesktop.beansbinding.BeanProperty.create("selectedElement"));
    bindingGroup.addBinding(binding);

    jScrollPane1.setViewportView(tableUsers);
    tableUsers.getColumnModel().getColumn(3).setCellRenderer(new TableCellTextAreaRenderer());
    tableUsers.getColumnModel().getColumn(4).setCellRenderer(new TableCellTextAreaRenderer());
    tableUsers.getColumnModel().getColumn(5).setMaxWidth(50);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                pnlHeader,
                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)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        pnlSearchCriteria,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        0,
                                        Short.MAX_VALUE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        jPanel1,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(
                                toolbarUsers,
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                563,
                                Short.MAX_VALUE))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addComponent(
                        pnlHeader,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                jPanel1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                pnlSearchCriteria,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        toolbarUsers,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        25,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
                    .addContainerGap()));

    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();

    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
Пример #29
0
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    rrrShareBean = CreateRrrShareBean();
    popupOwners = new javax.swing.JPopupMenu();
    menuAddOwner = new javax.swing.JMenuItem();
    menuEditOwner = new javax.swing.JMenuItem();
    menuRemoveOwner = new javax.swing.JMenuItem();
    menuViewOwner = new javax.swing.JMenuItem();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    txtDenominator = new javax.swing.JFormattedTextField();
    txtNominator = new javax.swing.JFormattedTextField();
    headerPanel = new org.sola.clients.swing.ui.HeaderPanel();
    groupPanel1 = new org.sola.clients.swing.ui.GroupPanel();
    jToolBar2 = new javax.swing.JToolBar();
    btnSave = new javax.swing.JButton();
    btnClose = new javax.swing.JButton();
    jToolBar1 = new javax.swing.JToolBar();
    btnAddOwner = new javax.swing.JButton();
    btnEditOwner = new javax.swing.JButton();
    btnRemoveOwner = new javax.swing.JButton();
    btnViewOwner = new javax.swing.JButton();
    btnSelectExisting = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    tableOwners = new org.sola.clients.swing.common.controls.JTableWithDefaultStyles();

    popupOwners.setName("popupOwners"); // NOI18N

    menuAddOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/add.png"))); // NOI18N
    java.util.ResourceBundle bundle =
        java.util.ResourceBundle.getBundle(
            "org/sola/clients/swing/desktop/administrative/Bundle"); // NOI18N
    menuAddOwner.setText(bundle.getString("SharePanel.menuAddOwner.text")); // NOI18N
    menuAddOwner.setName("menuAddOwner"); // NOI18N
    menuAddOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuAddOwnerActionPerformed(evt);
          }
        });
    popupOwners.add(menuAddOwner);

    menuEditOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/pencil.png"))); // NOI18N
    menuEditOwner.setText(bundle.getString("SharePanel.menuEditOwner.text")); // NOI18N
    menuEditOwner.setName("menuEditOwner"); // NOI18N
    menuEditOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuEditOwnerActionPerformed(evt);
          }
        });
    popupOwners.add(menuEditOwner);

    menuRemoveOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/remove.png"))); // NOI18N
    menuRemoveOwner.setText(bundle.getString("SharePanel.menuRemoveOwner.text")); // NOI18N
    menuRemoveOwner.setName("menuRemoveOwner"); // NOI18N
    menuRemoveOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuRemoveOwnerActionPerformed(evt);
          }
        });
    popupOwners.add(menuRemoveOwner);

    menuViewOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/view.png"))); // NOI18N
    menuViewOwner.setText(bundle.getString("SharePanel.menuViewOwner.text")); // NOI18N
    menuViewOwner.setName("menuViewOwner"); // NOI18N
    menuViewOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuViewOwnerActionPerformed(evt);
          }
        });
    popupOwners.add(menuViewOwner);

    setHeaderPanel(headerPanel);
    setHelpTopic("ownership_rrr"); // NOI18N
    setName("Form"); // NOI18N
    setPreferredSize(new java.awt.Dimension(662, 348));

    jLabel1.setFont(LafManager.getInstance().getLabFontBold());
    jLabel1.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N
    jLabel1.setText(bundle.getString("SharePanel.jLabel1.text")); // NOI18N
    jLabel1.setName("jLabel1"); // NOI18N

    jLabel2.setText(bundle.getString("SharePanel.jLabel2.text")); // NOI18N
    jLabel2.setToolTipText(bundle.getString("SharePanel.jLabel2.toolTipText")); // NOI18N
    jLabel2.setName("jLabel2"); // NOI18N

    txtDenominator.setFormatterFactory(FormattersFactory.getInstance().getShortFormatterFactory());
    txtDenominator.setText(bundle.getString("SharePanel.txtDenominator.text_1")); // NOI18N
    txtDenominator.setName("txtDenominator"); // NOI18N

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            rrrShareBean,
            org.jdesktop.beansbinding.ELProperty.create("${denominator}"),
            txtDenominator,
            org.jdesktop.beansbinding.BeanProperty.create("value"));
    bindingGroup.addBinding(binding);

    txtNominator.setFormatterFactory(FormattersFactory.getInstance().getShortFormatterFactory());
    txtNominator.setText(bundle.getString("SharePanel.txtNominator.text")); // NOI18N
    txtNominator.setName("txtNominator"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            rrrShareBean,
            org.jdesktop.beansbinding.ELProperty.create("${nominator}"),
            txtNominator,
            org.jdesktop.beansbinding.BeanProperty.create("value"));
    bindingGroup.addBinding(binding);

    txtNominator.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            txtNominatorActionPerformed(evt);
          }
        });

    headerPanel.setName("headerPanel"); // NOI18N
    headerPanel.setTitleText(bundle.getString("SharePanel.headerPanel.titleText")); // NOI18N

    groupPanel1.setName("groupPanel1"); // NOI18N
    groupPanel1.setTitleText(bundle.getString("SharePanel.groupPanel1.titleText")); // NOI18N

    jToolBar2.setFloatable(false);
    jToolBar2.setRollover(true);
    jToolBar2.setName("jToolBar2"); // NOI18N

    btnSave.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/save.png"))); // NOI18N
    btnSave.setText(bundle.getString("SharePanel.btnSave.text")); // NOI18N
    btnSave.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnSave.setName("btnSave"); // NOI18N
    btnSave.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSaveActionPerformed(evt);
          }
        });
    jToolBar2.add(btnSave);

    btnClose.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/confirm-close.png"))); // NOI18N
    btnClose.setText(bundle.getString("SharePanel.btnClose.text")); // NOI18N
    btnClose.setFocusable(false);
    btnClose.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnClose.setName("btnClose"); // NOI18N
    btnClose.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnClose.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnCloseActionPerformed(evt);
          }
        });
    jToolBar2.add(btnClose);

    jToolBar1.setFloatable(false);
    jToolBar1.setRollover(true);
    jToolBar1.setName("jToolBar1"); // NOI18N

    btnAddOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/add.png"))); // NOI18N
    btnAddOwner.setText(bundle.getString("SharePanel.btnAddOwner.text")); // NOI18N
    btnAddOwner.setName("btnAddOwner"); // NOI18N
    btnAddOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAddOwnerActionPerformed(evt);
          }
        });
    jToolBar1.add(btnAddOwner);

    btnEditOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/pencil.png"))); // NOI18N
    btnEditOwner.setText(bundle.getString("SharePanel.btnEditOwner.text")); // NOI18N
    btnEditOwner.setFocusable(false);
    btnEditOwner.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnEditOwner.setName("btnEditOwner"); // NOI18N
    btnEditOwner.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnEditOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnEditOwnerActionPerformed(evt);
          }
        });
    jToolBar1.add(btnEditOwner);

    btnRemoveOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/remove.png"))); // NOI18N
    btnRemoveOwner.setText(bundle.getString("SharePanel.btnRemoveOwner.text")); // NOI18N
    btnRemoveOwner.setToolTipText(bundle.getString("btnRemoveOwner.tooltip.text")); // NOI18N
    btnRemoveOwner.setName("btnRemoveOwner"); // NOI18N
    btnRemoveOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnRemoveOwnerActionPerformed(evt);
          }
        });
    jToolBar1.add(btnRemoveOwner);

    btnViewOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/view.png"))); // NOI18N
    btnViewOwner.setText(bundle.getString("SharePanel.btnViewOwner.text")); // NOI18N
    btnViewOwner.setName("btnViewOwner"); // NOI18N
    btnViewOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnViewOwnerActionPerformed(evt);
          }
        });
    jToolBar1.add(btnViewOwner);

    btnSelectExisting.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/search.png"))); // NOI18N
    btnSelectExisting.setText(bundle.getString("SharePanel.btnSelectExisting.text")); // NOI18N
    btnSelectExisting.setFocusable(false);
    btnSelectExisting.setName(bundle.getString("SharePanel.btnSelectExisting.name")); // NOI18N
    btnSelectExisting.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnSelectExisting.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSelectExistingActionPerformed(evt);
          }
        });
    jToolBar1.add(btnSelectExisting);

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    tableOwners.setComponentPopupMenu(popupOwners);
    tableOwners.setName("tableOwners"); // NOI18N

    org.jdesktop.beansbinding.ELProperty eLProperty =
        org.jdesktop.beansbinding.ELProperty.create("${filteredRightHolderList}");
    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            rrrShareBean,
            eLProperty,
            tableOwners);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${name}"));
    columnBinding.setColumnName("Name");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${lastName}"));
    columnBinding.setColumnName("Last Name");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            rrrShareBean,
            org.jdesktop.beansbinding.ELProperty.create("${selectedRightHolder}"),
            tableOwners,
            org.jdesktop.beansbinding.BeanProperty.create("selectedElement"));
    bindingGroup.addBinding(binding);

    jScrollPane1.setViewportView(tableOwners);
    if (tableOwners.getColumnModel().getColumnCount() > 0) {
      tableOwners
          .getColumnModel()
          .getColumn(0)
          .setHeaderValue(bundle.getString("SharePanel.tableOwners.columnModel.title0")); // NOI18N
      tableOwners
          .getColumnModel()
          .getColumn(1)
          .setHeaderValue(bundle.getString("SharePanel.tableOwners.columnModel.title1")); // NOI18N
    }

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                headerPanel,
                javax.swing.GroupLayout.Alignment.TRAILING,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE)
            .addComponent(
                jToolBar2,
                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(
                                groupPanel1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        txtNominator,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        42,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(6, 6, 6)
                                    .addComponent(jLabel2)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        txtDenominator,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        42,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(
                                jToolBar1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                463,
                                Short.MAX_VALUE))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addComponent(
                        headerPanel,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jToolBar2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        25,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(11, 11, 11)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(
                                txtNominator,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                txtDenominator,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addComponent(
                        groupPanel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jToolBar1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        25,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE)
                    .addContainerGap()));

    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();

    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();
  }