コード例 #1
0
ファイル: RienaDefaultLnf.java プロジェクト: jodoming/riena
 /**
  * Returns the integer value of the setting for the given key
  *
  * @param key key whose associated setting is to be returned.
  * @return the setting to which this setting maps the specified key, or <code>null</code> if the
  *     map contains no mapping for this key.
  */
 public Integer getIntegerSetting(final String key) {
   final Object value = getSetting(key);
   if (value == null) {
     if (Beans
         .isDesignTime()) { // in case of design time we return a "0" so that dependent code does
                            // not fail
       return new Integer(0);
     } else {
       return null;
     }
   }
   if (value instanceof Integer) {
     return (Integer) value;
   } else {
     final String strgValue = value.toString();
     try {
       return new Integer(strgValue);
     } catch (final NumberFormatException e) {
       if (Beans
           .isDesignTime()) { // in case of design time we return a "0" so that dependent code does
                              // not fail
         return Integer.valueOf(0);
       } else {
         return null;
       }
     }
   }
 }
コード例 #2
0
  public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
    if (Beans.isDesignTime()) {
      super.insertString(offs, str, a);
      return;
    }

    if (!validateEntry) {
      super.insertString(offs, str, a);
      validateEntry = true;
      return;
    }

    StringBuffer sb = new StringBuffer(getText(0, getLength()));
    sb.insert(offs, str);

    if (sb.toString().equals("-")) {
      super.insertString(offs, str, a);
      stringValue = null;
      value = null;
    } else {
      String text = sb.toString();
      if (text.equals("-.")) sb.insert(1, "0");
      else if (text.equals(".")) sb.insert(0, "0");

      Number num = decode(sb.toString());
      if (num != null) {
        super.insertString(offs, str, a);
        if (text.equals("-.") || text.equals(".")) super.insertString(offs, "0", a);

        stringValue = sb.toString();
        value = num;
      }
    }
  }
コード例 #3
0
ファイル: BeanInstance.java プロジェクト: CSLeicester/weka
  /**
   * Adds the supplied collection of beans at the supplied index in the list of collections. If the
   * index is not supplied then the primary collection is set (i.e. index 0). Also adds the beans to
   * the supplied JComponent container (if not null)
   *
   * @param beanInstances a <code>Vector</code> value
   * @param container a <code>JComponent</code> value
   */
  public static void setBeanInstances(
      Vector<Object> beanInstances, JComponent container, Integer... tab) {
    removeAllBeansFromContainer(container, tab);

    if (container != null) {
      for (int i = 0; i < beanInstances.size(); i++) {
        Object bean = ((BeanInstance) beanInstances.elementAt(i)).getBean();
        if (Beans.isInstanceOf(bean, JComponent.class)) {
          container.add((JComponent) bean);
        }
      }
      container.revalidate();
      container.repaint();
    }

    int index = 0;
    if (tab.length > 0) {
      index = tab[0].intValue();
    }

    if (index < TABBED_COMPONENTS.size()) {
      TABBED_COMPONENTS.set(index, beanInstances);
    }

    // COMPONENTS = beanInstances;
  }
コード例 #4
0
ファイル: Vues.java プロジェクト: T4g1/3eme
  public static String payement(HttpServletRequest request, HttpServletResponse response) {
    String html = "";
    try {
      // Ouvre la BDD
      BeanDBAccessORA dba = (BeanDBAccessORA) Beans.instantiate(null, "Bean.BeanDBAccessORA");

      if (dba.init()) {

        int session = 0;
        session = Integer.parseInt(request.getAttribute("session").toString());
        ResultSet result = dba.getcaddie(session);

        if (request.getParameter("action").equals("payer")) {
          dba.Paycaddie(session, 1);
          html += "paiement réussis !!!";
        } else {
          dba.Paycaddie(session, 0);
          html += "Annulation acceptée :( ";
        }

      } else {
        html = "dba.init() error";
      }
    } catch (SQLException ex) {
      html += "SQLException: " + ex.getMessage();
    } catch (IOException ex) {
      html += "IOException: " + ex.getMessage();
    } catch (ClassNotFoundException ex) {
      html += "ClassNotFoundException: " + ex.getMessage();
    }

    return html;
  }
コード例 #5
0
ファイル: PanelUsuarios.java プロジェクト: Codeko/Maimonides
 @Override
 protected ArrayList<Usuario> doInBackground() {
   ArrayList<Usuario> ret = new ArrayList<Usuario>();
   if (!Beans.isDesignTime()) {
     try {
       PreparedStatement st =
           (PreparedStatement)
               MaimonidesApp.getApplication()
                   .getConector()
                   .getConexion()
                   .prepareStatement(
                       "SELECT * FROM usuarios WHERE fbaja IS NULL ORDER BY nombre");
       ResultSet res = st.executeQuery();
       while (res.next()) {
         Usuario p = new Usuario();
         try {
           p.cargarDesdeResultSet(res);
           ret.add(p);
         } catch (SQLException ex) {
           Logger.getLogger(PanelUsuarios.class.getName()).log(Level.SEVERE, null, ex);
         } catch (Exception ex) {
           Logger.getLogger(PanelUsuarios.class.getName()).log(Level.SEVERE, null, ex);
         }
       }
       Obj.cerrar(st, res);
     } catch (SQLException ex) {
       Logger.getLogger(PanelUsuarios.class.getName()).log(Level.SEVERE, null, ex);
     }
   }
   return ret; // return your result
 }
コード例 #6
0
  private Election electionInstance() {
    if (election == null) {
      synchronized (syncPt) {
        if (election != null) return election;

        // new election
        String clazz = ElectionManager.conf.getElectionImplementation();
        System.out.println("class is " + clazz);
        // if an election instance already existed, this would
        // override the current election
        try {
          election = (Election) Beans.instantiate(this.getClass().getClassLoader(), clazz);
          election.setNodeId(conf.getNodeId());
          election.setListener(this);

          // this sucks - bad coding here! should use configuration
          // properties
          if (election instanceof Raft) {
            logger.warn("Node " + conf.getNodeId() + " setting max hops to arbitrary value (4)");
            ((Raft) election).setMaxHops(4);
          }

        } catch (Exception e) {
          logger.error("Failed to create " + clazz, e);
        }
      }
    }

    return election;
  }
コード例 #7
0
ファイル: BeanInstance.java プロジェクト: CSLeicester/weka
  /**
   * Removes all beans from containing component
   *
   * @param container a <code>JComponent</code> value
   */
  public static void removeAllBeansFromContainer(JComponent container, Integer... tab) {

    int index = 0;
    if (tab.length > 0) {
      index = tab[0].intValue();
    }

    Vector<Object> components = null;
    if (TABBED_COMPONENTS.size() > 0 && index < TABBED_COMPONENTS.size()) {
      components = TABBED_COMPONENTS.get(index);
    }

    if (container != null) {
      if (components != null) {
        for (int i = 0; i < components.size(); i++) {
          Object tempInstance = components.elementAt(i);
          Object tempBean = ((BeanInstance) tempInstance).getBean();
          if (Beans.isInstanceOf(tempBean, JComponent.class)) {
            container.remove((JComponent) tempBean);
          }
        }
      }
      container.revalidate();
    }
  }
コード例 #8
0
ファイル: XTabbedPane.java プロジェクト: sjroot/framework
  // <editor-fold defaultstate="collapsed" desc="  initComponents  ">
  private void initComponents() {
    if (Beans.isDesignTime()) {
      addTab("Tab 1", new JPanel());
    }

    Font f = ThemeUI.getFont("XTabbedPane.font");
    if (f != null) setFont(f);
  }
コード例 #9
0
ファイル: XLabel.java プロジェクト: sjroot/framework
  public String getText() {
    if (Beans.isDesignTime()) {
      if (!ValueUtil.isEmpty(expression)) return expression;
      else if (!ValueUtil.isEmpty(getName())) return getName();
      else return super.getText();

    } else {
      return super.getText();
    }
  }
コード例 #10
0
ファイル: Kit.java プロジェクト: cderoove/damp.ekeko.snippets
 // Get the delegated-to editor kit. Specified by classname, not
 // prototype; specifying by prototype would be possible but a little
 // harder, and would make it difficult to make a good property
 // editor for.
 private void updateDelegate() {
   try {
     delegate =
         (EditorKit)
             Beans.instantiate(TopManager.getDefault().systemClassLoader(), Settings.kitClass);
     if (Settings.debug) System.err.println("The delegate kit: " + delegate);
   } catch (Exception e) {
     TopManager.getDefault().notifyException(e);
   }
 }
コード例 #11
0
 /** Creates new form BeanForm */
 public ZTable() {
   initComponents();
   if (!Beans.isDesignTime()) {
     try {
       rowSet = new JdbcRowSetImpl(conn);
     } catch (Exception e) {
       e.printStackTrace();
     }
     dataBaru = new Vector();
   }
 }
コード例 #12
0
ファイル: ServletEvent.java プロジェクト: Tomty/3emeGestion
  private BeanAccesSQL ConnectionBD() {
    String Ip = new FichierConf().getConfig("config", "Ip");
    BeanAccesSQL DBSQL = null;
    try {
      DBSQL = (BeanAccesSQL) Beans.instantiate(null, "Beans.BeanAccesSQL");
      DBSQL.InitVar("Oracle", "192.168.2.8", "1521", "CC1", "CC1", "oracle", "orcl");
      DBSQL.Connect();
    } catch (IOException ex) {
    } catch (ClassNotFoundException ex) {
    }

    return DBSQL;
  }
コード例 #13
0
ファイル: Vues.java プロジェクト: T4g1/3eme
  /**
   * Donne le code HTML du contenu du caddie donné
   *
   * @param caddie Caddie voulu
   * @return Code HTML du contenu
   */
  public static String getCaddieContent(HttpServletRequest request, HttpServletResponse response) {
    int session = 0;
    session = Integer.parseInt(request.getAttribute("session").toString());
    String html =
        "<table border=1px>\n"
            + "    <tr>\n"
            + "        <th>salle</th>\n"
            + "        <th>sceance</th>\n"
            + "        <th>film</th>\n"
            + "        <th>date</th>\n"
            + "        <th>nombre de place</th>\n"
            + "    </tr>";

    try {
      // Ouvre la BDD
      BeanDBAccessORA dba = (BeanDBAccessORA) Beans.instantiate(null, "Bean.BeanDBAccessORA");

      if (dba.init()) {

        ResultSet result = dba.getcaddie(session);

        // Parcourt le caddie
        if (result != null) {
          while (result.next()) {
            html += "<tr>";
            html += "<td>" + result.getInt("idsalle") + "</td>";
            html += "<td>" + getHeureSceances(result.getInt("numsceance")) + "</td>";
            html += "<td>" + result.getString("titre") + "</td>";
            html += "<td>" + result.getString("datejour") + "</td>";
            html += "<td align=\"center\">" + result.getInt("nbplace") + "</td>";
            html += "</tr>";
          }
        }

      } else {
        html = "dba.init() error";
      }
    } catch (SQLException ex) {
      html = "SQLException: " + ex.getMessage();
    } catch (IOException ex) {
      html = "IOException: " + ex.getMessage();
    } catch (ClassNotFoundException ex) {
      html = "ClassNotFoundException: " + ex.getMessage();
    }

    html += "</table>";
    html += "<a href=\"Search?action=payer&id=" + session + " \">Payer</a>  ";
    html += "<a href=\"Search?action=annuler&id=" + session + "\">Annuler</a>";
    return html;
  }
コード例 #14
0
ファイル: BeanInstance.java プロジェクト: CSLeicester/weka
  /**
   * Creates a new <code>BeanInstance</code> instance given the fully qualified name of the bean
   *
   * @param container a <code>JComponent</code> to add the bean to
   * @param beanName the fully qualified name of the bean
   * @param x the x coordinate of the bean
   * @param y th y coordinate of the bean
   */
  public BeanInstance(JComponent container, String beanName, int x, int y, Integer... tab) {
    m_x = x;
    m_y = y;

    // try and instantiate the named component
    try {
      m_bean = Beans.instantiate(null, beanName);
    } catch (Exception ex) {
      ex.printStackTrace();
      return;
    }

    addBean(container, tab);
  }
コード例 #15
0
ファイル: OrderTable.java プロジェクト: akoyro/furman
 public OrderTable(ApplicationContext context) {
   super();
   this.context = context;
   if (!Beans.isDesignTime()) {
     setModel(new OrderDetailsTableModel());
     initTableCellComponents();
     setRowSelectionAllowed(false);
     setColumnSelectionAllowed(false);
     setCellSelectionEnabled(true);
     setSortable(false);
     getTableHeader().setReorderingAllowed(false);
     getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     //            setTableListeners();
   }
 }
コード例 #16
0
ファイル: OrderInfoTab.java プロジェクト: akoyro/furman
 /** Creates new form CustomerTab */
 public OrderInfoTab() {
   initComponents();
   changeEditable();
   readyValue.setDateFormatString("dd.MM.yyyy");
   costValue.setMask(regExp);
   if (!Beans.isDesignTime()) {
     addPropertyChangeListener(
         "editable",
         new PropertyChangeListener() {
           @Override
           public void propertyChange(PropertyChangeEvent evt) {
             changeEditable();
           }
         });
   }
 }
コード例 #17
0
ファイル: BeanInstance.java プロジェクト: CSLeicester/weka
  /**
   * Adds the supplied collection of beans to the end of the list of collections and to the
   * JComponent container (if not null)
   *
   * @param beanInstances the vector of bean instances to add
   * @param container
   */
  public static void addBeanInstances(Vector<Object> beanInstances, JComponent container) {
    // reset(container);

    if (container != null) {
      for (int i = 0; i < beanInstances.size(); i++) {
        Object bean = ((BeanInstance) beanInstances.elementAt(i)).getBean();
        if (Beans.isInstanceOf(bean, JComponent.class)) {
          container.add((JComponent) bean);
        }
      }
      container.revalidate();
      container.repaint();
    }

    TABBED_COMPONENTS.add(beanInstances);
  }
コード例 #18
0
  /** Creates new form PanelProfesores */
  public PanelProfesores() {
    initComponents();
    if (!Beans.isDesignTime()) {
      MaimonidesUtil.addMenuTabla(tabla, "Listado de Profesores");
      tabla.getColumnExt("Código Séneca").setVisible(false);
      tabla.setDefaultRenderer(
          GregorianCalendar.class,
          new DefaultTableCellRenderer() {

            @Override
            public void setValue(Object val) {
              if (val instanceof GregorianCalendar) {
                setText(Fechas.format((GregorianCalendar) val));
              } else {
                setText("");
              }
            }
          });

      tabla.setDefaultEditor(GregorianCalendar.class, new DateCellEditor());
      tabla
          .getSelectionModel()
          .addListSelectionListener(
              new ListSelectionListener() {

                @Override
                public void valueChanged(ListSelectionEvent e) {
                  if (!e.getValueIsAdjusting()) {
                    int pos = tabla.getSelectedRow();
                    Profesor p = null;
                    if (pos != -1) {
                      pos = tabla.convertRowIndexToModel(pos);
                      p = modelo.getElemento(pos);
                      setProfesorSeleccionado(p != null);
                    } else {
                      setProfesorSeleccionado(false);
                    }
                    firePropertyChange("profesorAsignado", null, p);
                  }
                }
              });
    }
    setHayEnviosWeb(EnviosWeb.hayEnviosWeb());
  }
コード例 #19
0
ファイル: BeanInstance.java プロジェクト: CSLeicester/weka
  /**
   * Adds this bean to the global list of beans and to the supplied container. The constructor calls
   * this method, so a client should not need to unless they have called removeBean and then wish to
   * have it added again.
   *
   * @param container the Component on which this BeanInstance will be displayed
   */
  public void addBean(JComponent container, Integer... tab) {

    int index = 0;
    if (tab.length > 0) {
      index = tab[0].intValue();
    }

    Vector<Object> components = null;
    if (TABBED_COMPONENTS.size() > 0 && index < TABBED_COMPONENTS.size()) {
      components = TABBED_COMPONENTS.get(index);
    }

    // do nothing if we are already in the list
    if (components.contains(this)) {
      return;
    }

    // Ignore invisible components
    if (!Beans.isInstanceOf(m_bean, JComponent.class)) {
      System.out.println("Component is invisible!");
      return;
    }

    components.addElement(this);

    // Position and layout the component
    JComponent c = (JComponent) m_bean;
    Dimension d = c.getPreferredSize();
    int dx = (int) (d.getWidth() / 2);
    int dy = (int) (d.getHeight() / 2);
    m_x -= dx;
    m_y -= dy;
    c.setLocation(m_x, m_y);
    // c.doLayout();
    c.validate();
    // bp.addBean(c);
    // c.repaint();
    if (container != null) {
      container.add(c);
      container.revalidate();
    }
  }
コード例 #20
0
ファイル: BeanInstance.java プロジェクト: CSLeicester/weka
  public static void appendBeans(JComponent container, Vector<Object> beans, int tab) {
    if (TABBED_COMPONENTS.size() > 0 && tab < TABBED_COMPONENTS.size()) {
      Vector<Object> components = TABBED_COMPONENTS.get(tab);
      //

      for (int i = 0; i < beans.size(); i++) {
        components.add(beans.get(i));
        if (container != null) {
          Object bean = ((BeanInstance) beans.elementAt(i)).getBean();
          if (Beans.isInstanceOf(bean, JComponent.class)) {
            container.add((JComponent) bean);
          }
        }
      }

      if (container != null) {
        container.revalidate();
        container.repaint();
      }
    }
  }
  public void performAction() {

    // TODO workaround; remove AFAIK
    Beans.setDesignTime(false);

    JDialog dialog =
        new JDialog(WindowManager.getDefault().getMainWindow(), "OpenGL Capabilities", false);

    dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    dialog.setResizable(false);
    dialog.addWindowListener(createWindowObserver());
    capsPanel = new GLCapabilitiesPanel();
    dialog.setContentPane(capsPanel);
    dialog.pack();

    dialog.setLocationRelativeTo(null);

    dialog.setVisible(true);

    EventQueue.invokeLater(createGLCapabilitiesQuery());
  }
コード例 #22
0
 @Override
 protected Vector<Profesor> doInBackground() {
   Vector<Profesor> ret = new Vector<Profesor>();
   if (!Beans.isDesignTime()) {
     try {
       if (Permisos.isUsuarioSoloProfesor() && Permisos.getFiltroProfesor() != null) {
         ret.add(Permisos.getFiltroProfesor());
       } else {
         PreparedStatement st =
             (PreparedStatement)
                 MaimonidesApp.getApplication()
                     .getConector()
                     .getConexion()
                     .prepareStatement(
                         "SELECT * FROM profesores_ WHERE ano=? ORDER BY nombre,apellido1,apellido2");
         st.setInt(1, MaimonidesApp.getApplication().getAnoEscolar().getId());
         ResultSet res = st.executeQuery();
         while (res.next()) {
           Profesor p = new Profesor();
           try {
             p.cargarDesdeResultSet(res);
             ret.add(p);
           } catch (SQLException ex) {
             Logger.getLogger(PanelProfesores.class.getName()).log(Level.SEVERE, null, ex);
           } catch (Exception ex) {
             Logger.getLogger(PanelProfesores.class.getName()).log(Level.SEVERE, null, ex);
           }
         }
         Obj.cerrar(st, res);
       }
     } catch (SQLException ex) {
       Logger.getLogger(PanelProfesores.class.getName()).log(Level.SEVERE, null, ex);
     }
   }
   return ret; // return your result
 }
コード例 #23
0
  /**
   * The instantiateChild method is a convenience hook in BeanContext to simplify the task of
   * instantiating a Bean, nested, into a <tt>BeanContext</tt>.
   *
   * <p>The semantics of the beanName parameter are defined by java.beans.Beans.instantate.
   *
   * @param beanName the name of the Bean to instantiate within this BeanContext
   * @throws IOException if there is an I/O error when the bean is being deserialized
   * @throws ClassNotFoundException if the class identified by the beanName parameter is not found
   * @return the new object
   */
  public Object instantiateChild(String beanName) throws IOException, ClassNotFoundException {
    BeanContext bc = getBeanContextPeer();

    return Beans.instantiate(bc.getClass().getClassLoader(), beanName, bc);
  }
コード例 #24
0
ファイル: FingerprintView.java プロジェクト: niels581/etf-mms
  /**
   * 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
コード例 #25
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 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
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    entityManager =
        java.beans.Beans.isDesignTime()
            ? null
            : javax.persistence.Persistence.createEntityManagerFactory("proyectoPU")
                .createEntityManager();
    query =
        java.beans.Beans.isDesignTime()
            ? null
            : entityManager.createQuery("SELECT p FROM Proveedor p");
    list =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : org.jdesktop.observablecollections.ObservableCollections.observableList(
                query.getResultList());
    categoriaArticuloQuery =
        java.beans.Beans.isDesignTime()
            ? null
            : entityManager.createQuery("SELECT c FROM CategoriaArticulo c");
    categoriaArticuloList =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : categoriaArticuloQuery.getResultList();
    jPanel1 = new javax.swing.JPanel();
    tf_telef = new javax.swing.JTextField();
    tf_email = new javax.swing.JTextField();
    lbl_direccion = new javax.swing.JLabel();
    lbl_ruc = new javax.swing.JLabel();
    tf_ruc = new javax.swing.JTextField();
    tf_cedula = new javax.swing.JTextField();
    lbl_email = new javax.swing.JLabel();
    tf_direccion = new javax.swing.JTextField();
    lbl_razonSocial = new javax.swing.JLabel();
    lbl_telef = new javax.swing.JLabel();
    tf_razonSocial = new javax.swing.JTextField();
    lbl_apellido1 = new javax.swing.JLabel();
    jLabel1 = new javax.swing.JLabel();
    combotipo = new javax.swing.JComboBox();
    lbl_cedula1 = new javax.swing.JLabel();
    lbl_telef1 = new javax.swing.JLabel();
    combo_cat = new javax.swing.JComboBox();
    jPanel2 = new javax.swing.JPanel();
    btn_cancelar = new javax.swing.JButton();
    btn_guardar = new javax.swing.JButton();
    jPanel3 = new javax.swing.JPanel();
    lbl_registrarC = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setResizable(false);

    jPanel1.setBackground(new java.awt.Color(204, 204, 204));
    jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    tf_telef.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            tf_telefKeyTyped(evt);
          }
        });

    tf_email.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            tf_emailActionPerformed(evt);
          }
        });
    tf_email.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            tf_emailKeyTyped(evt);
          }
        });

    lbl_direccion.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_direccion.setText("Dirección:");

    lbl_ruc.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_ruc.setText("RUC:");

    tf_ruc.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            tf_rucActionPerformed(evt);
          }
        });
    tf_ruc.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusLost(java.awt.event.FocusEvent evt) {
            tf_rucFocusLost(evt);
          }
        });
    tf_ruc.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            tf_rucKeyTyped(evt);
          }
        });

    tf_cedula.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            tf_cedulaActionPerformed(evt);
          }
        });
    tf_cedula.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusLost(java.awt.event.FocusEvent evt) {
            tf_cedulaFocusLost(evt);
          }
        });
    tf_cedula.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            tf_cedulaKeyTyped(evt);
          }
        });

    lbl_email.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_email.setText("Email:");

    tf_direccion.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            tf_direccionKeyTyped(evt);
          }
        });

    lbl_razonSocial.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_razonSocial.setText("Razon Social:");

    lbl_telef.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_telef.setText("Teléfono:");

    tf_razonSocial.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            tf_razonSocialActionPerformed(evt);
          }
        });
    tf_razonSocial.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            tf_razonSocialKeyTyped(evt);
          }
        });

    lbl_apellido1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_apellido1.setText("Tipo");

    jLabel1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    jLabel1.setText("'N': Natural o 'J': Juridico");

    combotipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] {"N", "J"}));
    combotipo.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseClicked(java.awt.event.MouseEvent evt) {
            combotipoMouseClicked(evt);
          }
        });
    combotipo.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            combotipoActionPerformed(evt);
          }
        });

    lbl_cedula1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_cedula1.setText("Cedula:");

    lbl_telef1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_telef1.setText("Categoria Proveedor:");

    org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding =
        org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            categoriaArticuloList,
            combo_cat);
    bindingGroup.addBinding(jComboBoxBinding);

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbl_razonSocial)
                            .addComponent(lbl_ruc)
                            .addComponent(lbl_apellido1)
                            .addComponent(lbl_cedula1)
                            .addComponent(lbl_telef1))
                    .addGap(32, 32, 32)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                jPanel1Layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        jPanel1Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(
                                                tf_razonSocial,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                146,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(
                                                jPanel1Layout
                                                    .createSequentialGroup()
                                                    .addComponent(
                                                        combotipo,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(jLabel1))
                                            .addComponent(
                                                tf_ruc,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                102,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                tf_cedula,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                102,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(
                                        jPanel1Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                jPanel1Layout
                                                    .createSequentialGroup()
                                                    .addGap(49, 49, 49)
                                                    .addGroup(
                                                        jPanel1Layout
                                                            .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment
                                                                    .LEADING)
                                                            .addComponent(lbl_email)
                                                            .addComponent(lbl_direccion)))
                                            .addGroup(
                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                jPanel1Layout
                                                    .createSequentialGroup()
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(lbl_telef))))
                            .addComponent(
                                combo_cat,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                171,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 75, Short.MAX_VALUE)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                tf_email,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                161,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                tf_direccion,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                161,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                tf_telef,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                122,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(20, 20, 20)));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addGap(19, 19, 19)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbl_apellido1)
                            .addComponent(jLabel1)
                            .addComponent(
                                combotipo,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(26, 26, 26)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                tf_email,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lbl_email)
                            .addComponent(lbl_razonSocial)
                            .addComponent(
                                tf_razonSocial,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                tf_ruc,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lbl_ruc)
                            .addComponent(lbl_direccion)
                            .addComponent(
                                tf_direccion,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(21, 21, 21)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                tf_cedula,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lbl_cedula1)
                            .addComponent(
                                tf_telef,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lbl_telef))
                    .addGap(18, 18, 18)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                combo_cat,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lbl_telef1))
                    .addContainerGap(36, Short.MAX_VALUE)));

    jPanel2.setBackground(new java.awt.Color(204, 204, 204));
    jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    btn_cancelar.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/imagenes/delete.png"))); // NOI18N
    btn_cancelar.setText("Cancelar");
    btn_cancelar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btn_cancelarActionPerformed(evt);
          }
        });

    btn_guardar.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/imagenes/guardar.png"))); // NOI18N
    btn_guardar.setText("Guardar");
    btn_guardar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btn_guardarActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel2Layout
                    .createSequentialGroup()
                    .addGap(34, 34, 34)
                    .addComponent(btn_guardar)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 63, Short.MAX_VALUE)
                    .addComponent(btn_cancelar)
                    .addGap(34, 34, 34)));
    jPanel2Layout.setVerticalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel2Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel2Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addComponent(btn_cancelar)
                                    .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(
                                btn_guardar,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addContainerGap()));

    jPanel3.setBackground(new java.awt.Color(0, 153, 255));
    jPanel3.setBorder(
        javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));

    lbl_registrarC.setFont(new java.awt.Font("Corbel", 1, 30)); // NOI18N
    lbl_registrarC.setForeground(new java.awt.Color(255, 255, 255));
    lbl_registrarC.setText("Crear Proveedor");

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel3Layout
                    .createSequentialGroup()
                    .addGap(128, 128, 128)
                    .addComponent(lbl_registrarC)
                    .addContainerGap(226, Short.MAX_VALUE)));
    jPanel3Layout.setVerticalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel3Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(lbl_registrarC)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addComponent(
                                        jPanel1,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(64, 64, 64)
                                    .addComponent(
                                        jPanel3,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap())
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(132, 132, 132)
                    .addComponent(
                        jPanel2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addGap(20, 20, 20)
                    .addComponent(
                        jPanel3,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(29, 29, 29)
                    .addComponent(
                        jPanel1,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addGap(18, 18, 18)
                    .addComponent(
                        jPanel2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(32, 32, 32)));

    bindingGroup.bind();

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #27
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
コード例 #28
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
コード例 #29
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
コード例 #30
0
ファイル: Beans.java プロジェクト: bloodstars/OpenJDK
 /**
  * Instantiate a JavaBean.
  *
  * @return a JavaBean
  * @param cls the class-loader from which we should create the bean. If this is null, then the
  *     system class-loader is used.
  * @param beanName the name of the bean within the class-loader. For example "sun.beanbox.foobah"
  * @param beanContext The BeanContext in which to nest the new bean
  * @exception ClassNotFoundException if the class of a serialized object could not be found.
  * @exception IOException if an I/O error occurs.
  */
 public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext)
     throws IOException, ClassNotFoundException {
   return Beans.instantiate(cls, beanName, beanContext, null);
 }