Package com.commander4j.gui

Examples of com.commander4j.gui.JButton4j


        jDesktopPane1.setBackground(Color.WHITE);
        getContentPane().add(jDesktopPane1, BorderLayout.CENTER);
        jDesktopPane1.setPreferredSize(new java.awt.Dimension(350, 182));
        jDesktopPane1.setLayout(null);
        {
          jButtonUpdate = new JButton4j(Common.icon_save);
          jDesktopPane1.add(jButtonUpdate);
          jButtonUpdate.setEnabled(false);
          jButtonUpdate.setText(lang.get("btn_Save"));
          jButtonUpdate.setMnemonic(lang.getMnemonicChar());
          jButtonUpdate.setBounds(7, 133, 112, 28);
          jButtonUpdate.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {

              try
              {
                materialbatch.setStatus((String) jComboBoxStatus.getSelectedItem());
              }
              catch (Exception e)
              {
                materialbatch.setStatus("");
              }
              Date d = dateTimePicker.getDate();
              materialbatch.setExpiryDate(JUtility.getTimestampFromDate(d));
              if (materialbatch.isValidMaterialBatch())
              {
                materialbatch.update();
              }
              else
              {
                materialbatch.create();
              }
              jButtonUpdate.setEnabled(false);
            }
          });
        }
        {
          jButtonHelp = new JButton4j(Common.icon_help);
          jDesktopPane1.add(jButtonHelp);
          jButtonHelp.setText(lang.get("btn_Help"));
          jButtonHelp.setMnemonic(lang.getMnemonicChar());
          jButtonHelp.setBounds(119, 133, 112, 28);
        }
        {
          jButtonCancel = new JButton4j(Common.icon_close);
          jDesktopPane1.add(jButtonCancel);
          jButtonCancel.setText(lang.get("btn_Close"));
          jButtonCancel.setMnemonic(lang.getMnemonicChar());
          jButtonCancel.setBounds(231, 133, 112, 28);
          jButtonCancel.addActionListener(new ActionListener() {
View Full Code Here


        getContentPane().add(jDesktopPane1, BorderLayout.SOUTH);
        jDesktopPane1.setPreferredSize(new java.awt.Dimension(357, 518));
        jDesktopPane1.setBorder(BorderFactory.createTitledBorder(""));
        jDesktopPane1.setLayout(null);
        {
          jButtonSelect = new JButton4j(Common.icon_ok);
          jDesktopPane1.add(jButtonSelect);
          jButtonSelect.setText("Select");
          jButtonSelect.setBounds(126, 98, 105, 28);
          jButtonSelect.setMnemonic(java.awt.event.KeyEvent.VK_L);
          jButtonSelect.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              if (jListData.isSelectionEmpty() == false)
              {
                dlg_selected_var = ((String) jListData.getSelectedValue()).substring(0, dlg_table.getColumnSizeForField(dlg_key_field_name));
                dlg_selected = true;
                try
                {
                  listStatement.close();
                }
                catch (SQLException e)
                {
                  e.printStackTrace();
                }
                dispose();
              }
            }
          });
        }
        {
          jButtonCancel = new JButton4j(Common.icon_cancel);
          jDesktopPane1.add(jButtonCancel);
          jButtonCancel.setText("Cancel");
          jButtonCancel.setBounds(238, 98, 105, 28);
          jButtonCancel.setMnemonic(java.awt.event.KeyEvent.VK_C);
          jButtonCancel.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              dlg_selected = false;
              dlg_selected_var = "";
              try
              {
                listStatement.close();
              }
              catch (SQLException e)
              {
                e.printStackTrace();
              }
              dispose();
            }
          });
        }
        {
          jTextFieldCriteria = new JTextField4j();
          jDesktopPane1.add(jTextFieldCriteria);
          jTextFieldCriteria.setBounds(70, 35, 385, 21);
        }
        {
          ComboBoxModel jComboBox1Model = new DefaultComboBoxModel(dlg_table.getFieldNames());
          jComboBoxCriteria = new JComboBox4j();
          jDesktopPane1.add(jComboBoxCriteria);
          jComboBoxCriteria.setModel(jComboBox1Model);
          jComboBoxCriteria.setBounds(70, 7, 182, 23);
          jComboBoxCriteria.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              jTextFieldCriteria.setText("");
            }
          });
          jComboBoxCriteria.setSelectedIndex(dlg_criteria_field_name_default_pos);
        }
        {
          ComboBoxModel jComboBox2Model = new DefaultComboBoxModel(dlg_table.getFieldNames());
          jComboBoxOrderBy = new JComboBox4j();
          jDesktopPane1.add(jComboBoxOrderBy);
          jComboBoxOrderBy.setModel(jComboBox2Model);
          jComboBoxOrderBy.setBounds(70, 63, 182, 23);
          jComboBoxOrderBy.setSelectedIndex(dlg_orderBy_name_default_pos);
        }

        {
          jLabel1 = new JLabel4j_std();
          jDesktopPane1.add(jLabel1);
          jLabel1.setText("Value :");
          jLabel1.setBounds(0, 35, 63, 21);
          jLabel1.setHorizontalAlignment(SwingConstants.TRAILING);
        }
        {
          jLabel2 = new JLabel4j_std();
          jDesktopPane1.add(jLabel2);
          jLabel2.setText("Criteria :");
          jLabel2.setBounds(0, 7, 63, 21);
          jLabel2.setHorizontalAlignment(SwingConstants.TRAILING);
        }
        {
          jLabel3 = new JLabel4j_std();
          jDesktopPane1.add(jLabel3);
          jLabel3.setText("Order By :");
          jLabel3.setBounds(0, 63, 63, 21);
          jLabel3.setHorizontalAlignment(SwingConstants.TRAILING);
        }
        {
          jScrollPane1 = new JScrollPane();
          jDesktopPane1.add(jScrollPane1);
          jScrollPane1.setBounds(7, 154, 448, 350);
          jScrollPane1.getHorizontalScrollBar().addComponentListener(new ComponentAdapter() {
            public void componentResized(ComponentEvent evt) {
              if (jScrollPane1.getHorizontalScrollBar().isVisible() == true)
              {
                me.setSize(me.getSize().width + 50, (me.getSize().height));
                screen = Toolkit.getDefaultToolkit().getScreenSize();
                window = getBounds();
                setLocation((screen.width - window.width) / 2, (screen.height - window.height) / 2);
                me.validate();
              }
            }
          });
          {
            ListModel jList1Model = new DefaultComboBoxModel();

            jListData = new JList4j();
            jScrollPane1.setViewportView(jListData);
            jListData.setModel(jList1Model);
            jListData.setCellRenderer(Common.renderer_list);
            jListData.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            jListData.setFont(Common.font_list);
            jListData.addMouseListener(new MouseAdapter() {
              public void mouseClicked(MouseEvent evt) {
                if (evt.getClickCount() == 2)
                {
                  jButtonSelect.doClick();
                }
              }
            });
          }
        }
        {
          jToggleButtonSequence = new JToggleButton(Common.icon_ascending);
          jDesktopPane1.add(jToggleButtonSequence);
          jToggleButtonSequence.setBounds(259, 63, 21, 21);
          jToggleButtonSequence.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              setSequence(jToggleButtonSequence.isSelected());
            }
          });
        }
        {

          jButtonSearch = new JButton4j(Common.icon_search);
          jDesktopPane1.add(jButtonSearch);
          jButtonSearch.setText("Search");
          jButtonSearch.setBounds(14, 98, 105, 28);
          jButtonSearch.setMnemonic(java.awt.event.KeyEvent.VK_S);
          jButtonSearch.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              search();
            }
          });
        }
        {
          jTextFieldHeading = new JLabel4j_std();
          jDesktopPane1.add(jTextFieldHeading);
          jTextFieldHeading.setBounds(7, 133, 448, 21);
          jTextFieldHeading.setHorizontalAlignment(SwingConstants.LEFT);
          jTextFieldHeading.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
        }
        {
          jButtonHelp = new JButton4j(Common.icon_help);
          jDesktopPane1.add(jButtonHelp);
          jButtonHelp.setText("Help");
          jButtonHelp.setMnemonic(java.awt.event.KeyEvent.VK_H);
          jButtonHelp.setBounds(350, 98, 105, 28);
        }
View Full Code Here

            jListAssigned.setCellRenderer(Common.renderer_list_assigned);
            jListAssigned.setBackground(Common.color_list_assigned);
          }
        }
        {
          jButtonRefresh = new JButton4j(Common.icon_refresh);
          jButtonRefresh.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
              populateLineList();
              populateUnAssignedList(null);
              populateAssignedList(null);
            }
          });
          jButtonRefresh.setText(lang.get("btn_Refresh"));
          jButtonRefresh.setBounds(113, 382, 116, 30);
          jDesktopPane1.add(jButtonRefresh);
        }
        {
          jButtonAssign = new JButton4j(Common.icon_arrow_left);
          jDesktopPane1.add(jButtonAssign);
          jButtonAssign.setBounds(390, 156, 25, 25);
          jButtonAssign.setEnabled(false);
          jButtonAssign.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              if (jListUnAssigned.getSelectedIndex() > -1)
              {
                JDBPrinterLineMembership plm = new JDBPrinterLineMembership(Common.selectedHostID, Common.sessionID);
                for (int j = jListUnAssigned.getMaxSelectionIndex(); j >= jListUnAssigned.getMinSelectionIndex(); j--)
                {
                  if (jListUnAssigned.isSelectedIndex(j))
                  {
                    JDBListData item = (JDBListData) jListUnAssigned.getModel().getElementAt(j);

                    if (plm.addPrintertoLine(jListLines.getSelectedValue().toString(), item.toString()))
                    {
                      addToList(assignedList, item, false);
                    }
                  }
                }

                for (int j = jListUnAssigned.getMaxSelectionIndex(); j >= jListUnAssigned.getMinSelectionIndex(); j--)
                {
                  if (jListUnAssigned.isSelectedIndex(j))
                  {
                    Object item = jListUnAssigned.getModel().getElementAt(j);

                      removeFromList(unassignedList, item);

                  }
                }

                refreshJList(jListAssigned, assignedModel, assignedList);
                refreshJList(jListUnAssigned, unassignedModel, unassignedList);

                setButtonState();
              }

            }
          });
        }
        {
          jButtonUnAssign = new JButton4j(Common.icon_arrow_right);
          jDesktopPane1.add(jButtonUnAssign);
          jButtonUnAssign.setBounds(390, 185, 25, 25);
          jButtonUnAssign.setEnabled(false);
          jButtonUnAssign.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              if (jListAssigned.getSelectedIndex() > -1)
              {
                JDBPrinterLineMembership plm = new JDBPrinterLineMembership(Common.selectedHostID, Common.sessionID);
                for (int j = jListAssigned.getMaxSelectionIndex(); j >= jListAssigned.getMinSelectionIndex(); j--)
                {
                  if (jListAssigned.isSelectedIndex(j))
                  {
                    JDBListData item = (JDBListData) jListAssigned.getModel().getElementAt(j);

                    addToList(unassignedList, item, true);
                  }
                }

                for (int j = jListAssigned.getMaxSelectionIndex(); j >= jListAssigned.getMinSelectionIndex(); j--)
                {
                  if (jListAssigned.isSelectedIndex(j))
                  {
                    Object item = jListAssigned.getModel().getElementAt(j);

                   
                   
                    if (plm.removePrinterfromLine(jListLines.getSelectedValue().toString(), item.toString()))
                    {
                      removeFromList(assignedList, item);
                    }
                  }
                }
                refreshJList(jListUnAssigned, unassignedModel, unassignedList);
                refreshJList(jListAssigned, assignedModel, assignedList);

                setButtonState();
              }
            }
          });
        }

        {
          jButtonClose = new JButton4j(Common.icon_close);
          jDesktopPane1.add(jButtonClose);
          jButtonClose.setText(lang.get("btn_Close"));
          jButtonClose.setBounds(350, 382, 116, 30);
          jButtonClose.setMnemonic(lang.getMnemonicChar());
          jButtonClose.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              dispose();
            }
          });
        }
        {
          jLabel1 = new JLabel4j_title();
          jDesktopPane1.add(jLabel1);
          jLabel1.setText(lang.get("lbl_Line_ID"));
          jLabel1.setBounds(12, 7, 60, 16);
        }
        {
          jLabel2 = new JLabel4j_title();
          jDesktopPane1.add(jLabel2);
          jLabel2.setText("Unassigned");
          jLabel2.setBounds(427, 5, 136, 21);
        }
        {
          jLabel3 = new JLabel4j_title();
          jDesktopPane1.add(jLabel3);
          jLabel3.setText("Assigned");
          jLabel3.setBounds(202, 6, 71, 18);
        }
        {
          jButtonHelp = new JButton4j(Common.icon_help);
          jDesktopPane1.add(jButtonHelp);
          jButtonHelp.setText(lang.get("btn_Help"));
          jButtonHelp.setBounds(232, 382, 116, 30);
          jButtonHelp.setMnemonic(lang.getMnemonicChar());
        }
View Full Code Here

          jTextFieldSSCC.setEditable(false);
          jTextFieldSSCC.setEnabled(false);
          jTextFieldSSCC.setBounds(147, 6, 147, 21);
        }
        {
          jButtonSave = new JButton4j(Common.icon_update);
          jDesktopPane1.add(jButtonSave);
          jButtonSave.setEnabled(false);
          jButtonSave.setText(lang.get("btn_Save"));
          jButtonSave.setMnemonic(lang.getMnemonicChar());
          jButtonSave.setBounds(3, 502, 111, 28);
          jButtonSave.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              boolean result = true;

              long txnRef = 0;

              if (pallet.isValidPallet(lsscc) == true) {
                txnRef = pallet.writePalletHistory(txnRef, "EDIT", "FROM");
              }

              pallet.setProcessOrder(jTextFieldProcessOrder.getText());
              pallet.setMaterial(jTextFieldMaterial.getText());
              pallet.setBatchNumber(jTextFieldBatch.getText());
              pallet.setLocationID(jTextFieldLocation.getText());
              Date dom = productionDate.getDate();
              pallet.setDateOfManufacture(JUtility.getTimestampFromDate(dom));

              pallet.setQuantity(jFormattedTextFieldQuantity.getQuantity());
              pallet.setDespatchNo(textFieldDespatchNo.getText());
              pallet.setCustomerID(textFieldCustomer.getText());
              Date exp = expiryDate.getDate();
              pallet.setBatchExpiry(JUtility.getTimestampFromDate(exp));
              if (expiryMode.equals("SSCC")) {
                try {
                  Date d = expiryDate.getDate();
                  pallet.setBatchExpiry(JUtility.getTimestampFromDate(d));
                } catch (Exception ex) {

                }
              }

              if (pallet.isValidPallet(lsscc) == true) {
                result = pallet.update();
                if (result == true) {
                  pallet.writePalletHistory(txnRef, "EDIT", "TO");
                  pallet.updateStatus((String) jComboBoxDefaultPalletStatus.getSelectedItem());

                  jTextFieldLayers.setText(String.valueOf(pallet.getLayersOnPallet()));
                  enableOrdisableFields(null);
                  jButtonSave.setEnabled(false);
                  jButtonUndo.setEnabled(false);
                } else {
                  JUtility.errorBeep();
                  JOptionPane.showMessageDialog(Common.mainForm, pallet.getErrorMessage(), "Error", JOptionPane.ERROR_MESSAGE);

                }
              } else {
                result = pallet.create();
                if (result == true) {
                  txnRef = pallet.writePalletHistory(txnRef, "EDIT", "CREATE");
                  jTextFieldLayers.setText(String.valueOf(pallet.getLayersOnPallet()));
                  enableOrdisableFields(null);
                  jButtonSave.setEnabled(false);
                  jButtonUndo.setEnabled(false);
                } else {
                  JUtility.errorBeep();
                  JOptionPane.showMessageDialog(Common.mainForm, pallet.getErrorMessage(), "Error", JOptionPane.ERROR_MESSAGE);

                }
              }
            }
          });
        }
        {
          jButtonHelp = new JButton4j(Common.icon_help);
          jDesktopPane1.add(jButtonHelp);
          jButtonHelp.setText(lang.get("btn_Help"));
          jButtonHelp.setMnemonic(lang.getMnemonicChar());
          jButtonHelp.setBounds(229, 502, 111, 28);
        }
        {
          jButtonCancel = new JButton4j(Common.icon_close);
          jDesktopPane1.add(jButtonCancel);
          jButtonCancel.setText(lang.get("btn_Close"));
          jButtonCancel.setMnemonic(lang.getMnemonicChar());
          jButtonCancel.setBounds(342, 502, 111, 28);
          jButtonCancel.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              dispose();
            }
          });
        }
        {
          ComboBoxModel jComboBoxBaseUOMModel = new DefaultComboBoxModel(uomList);
          jComboBoxUOM = new JComboBox4j();
          jDesktopPane1.add(jComboBoxUOM);
          jComboBoxUOM.setModel(jComboBoxBaseUOMModel);
          jComboBoxUOM.setMaximumRowCount(12);
          jComboBoxUOM.setBounds(147, 280, 287, 23);
          jComboBoxUOM.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_PALLET_EDIT_UOM"));
          jComboBoxUOM.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              uomChanged();
            }
          });

        }
        {
          jLabel1 = new JLabel4j_std();
          jDesktopPane1.add(jLabel1);
          jLabel1.setText(lang.get("lbl_Pallet_SSCC"));
          jLabel1.setBounds(7, 6, 133, 21);
          jLabel1.setHorizontalAlignment(SwingConstants.TRAILING);
        }
        {
          jLabel5 = new JLabel4j_std();
          jDesktopPane1.add(jLabel5);
          jLabel5.setBounds(7, 280, 133, 21);
          jLabel5.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel5.setText(lang.get("lbl_Material_UOM"));
        }
        {
          jLabel15 = new JLabel4j_std();
          jDesktopPane1.add(jLabel15);
          jLabel15.setText(lang.get("lbl_Pallet_Status"));
          jLabel15.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel15.setBounds(7, 389, 133, 21);
        }
        {
          textFieldDespatchNo = new JTextField4j();
          textFieldDespatchNo.setFocusCycleRoot(true);
          textFieldDespatchNo.setEnabled(false);
          textFieldDespatchNo.setBounds(147, 446, 119, 21);
          textFieldDespatchNo.addKeyListener(new KeyAdapter() {
            public void keyReleased(KeyEvent evt) {
              despatchNoChanged();
            }
          });
          jDesktopPane1.add(textFieldDespatchNo);
        }
        {
          ComboBoxModel jComboBox1Model = new DefaultComboBoxModel(Common.palletStatus);
          jComboBoxDefaultPalletStatus = new JComboBox4j();
          jDesktopPane1.add(jComboBoxDefaultPalletStatus);
          jComboBoxDefaultPalletStatus.setModel(jComboBox1Model);
          jComboBoxDefaultPalletStatus.setBounds(147, 389, 168, 23);
          jComboBoxDefaultPalletStatus.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_PALLET_EDIT_STATUS"));
          jComboBoxDefaultPalletStatus.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              jButtonSave.setEnabled(true);
              jButtonUndo.setEnabled(true);
            }
          });
        }
        {
          jLabel2 = new JLabel4j_std();
          jDesktopPane1.add(jLabel2);
          jLabel2.setText(lang.get("lbl_Material"));
          jLabel2.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel2.setBounds(7, 87, 133, 21);
        }
        {
          jTextFieldMaterial = new JTextField4j();
          AbstractDocument doc = (AbstractDocument) jTextFieldMaterial.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBMaterial.field_material));
          jDesktopPane1.add(jTextFieldMaterial);
          jTextFieldMaterial.setBounds(147, 87, 119, 21);
          jTextFieldMaterial.setEditable(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_PALLET_EDIT_MATERIAL"));
          jTextFieldMaterial.addKeyListener(new KeyAdapter() {
            public void keyReleased(KeyEvent evt) {
              materialChanged();
            }
          });
        }
        {
          jButtonLookupMaterial = new JButton4j(Common.icon_lookup);
          jDesktopPane1.add(jButtonLookupMaterial);
          jButtonLookupMaterial.setBounds(266, 87, 21, 21);
          jButtonLookupMaterial.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_PALLET_EDIT_MATERIAL"));
          jButtonLookupMaterial.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              JLaunchLookup.dlgAutoExec = false;
              JLaunchLookup.dlgCriteriaDefault = "";
              if (JLaunchLookup.materials()) {
                jTextFieldMaterial.setText(JLaunchLookup.dlgResult);
                materialChanged();

              }
            }
          });
        }
        {
          jLabel3 = new JLabel4j_std();
          jDesktopPane1.add(jLabel3);
          jLabel3.setText(lang.get("lbl_Material_Batch"));
          jLabel3.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel3.setBounds(7, 141, 133, 21);
        }
        {
          jTextFieldBatch = new JTextField4j();
          AbstractDocument doc = (AbstractDocument) jTextFieldBatch.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBMaterialBatch.field_batch_number));
          jDesktopPane1.add(jTextFieldBatch);
          jTextFieldBatch.setBounds(147, 141, 119, 21);
          jTextFieldBatch.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_PALLET_EDIT_BATCH"));
          jTextFieldBatch.addKeyListener(new KeyAdapter() {
            public void keyReleased(KeyEvent evt) {
              materialBatchChanged();
            }
          });
        }
        {
          jButtonLookupBatch = new JButton4j(Common.icon_lookup);
          jDesktopPane1.add(jButtonLookupBatch);
          jButtonLookupBatch.setBounds(266, 141, 21, 21);
          jButtonLookupBatch.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_PALLET_EDIT_BATCH"));
          jButtonLookupBatch.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              JLaunchLookup.dlgCriteriaDefault = jTextFieldMaterial.getText();
              JLaunchLookup.dlgAutoExec = true;
              if (JLaunchLookup.materialBatches()) {
                jTextFieldBatch.setText(JLaunchLookup.dlgResult);
                materialBatchChanged();
              }
            }
          });
        }
        {
          jLabel4 = new JLabel4j_std();
          jDesktopPane1.add(jLabel4);
          jLabel4.setText(lang.get("lbl_Location_ID"));
          jLabel4.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel4.setBounds(7, 226, 133, 21);
        }
        {
          jTextFieldLocation = new JTextField4j();
          AbstractDocument doc = (AbstractDocument) jTextFieldLocation.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBLocation.field_location_id));
          jDesktopPane1.add(jTextFieldLocation);
          jTextFieldLocation.setBounds(147, 226, 119, 21);
          jTextFieldLocation.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_PALLET_EDIT_LOCATION"));
          jTextFieldLocation.addKeyListener(new KeyAdapter() {
            public void keyReleased(KeyEvent evt) {
              locationChanged();
            }
          });
        }
        {
          jButtonLookupLocation = new JButton4j(Common.icon_lookup);
          jDesktopPane1.add(jButtonLookupLocation);
          jButtonLookupLocation.setBounds(266, 226, 21, 21);
          jButtonLookupLocation.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_PALLET_EDIT_LOCATION"));
          jButtonLookupLocation.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              JLaunchLookup.dlgAutoExec = true;
              JLaunchLookup.dlgCriteriaDefault = "Y";
              if (JLaunchLookup.locations()) {
                jTextFieldLocation.setText(JLaunchLookup.dlgResult);
                locationChanged();
              }
            }
          });
        }
        {
          jLabelProcessOrder = new JLabel4j_std();
          jDesktopPane1.add(jLabelProcessOrder);
          jLabelProcessOrder.setText(lang.get("lbl_Process_Order"));
          jLabelProcessOrder.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabelProcessOrder.setBounds(7, 33, 133, 21);
        }
        {
          jTextFieldProcessOrder = new JTextField4j();
          AbstractDocument doc = (AbstractDocument) jTextFieldProcessOrder.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBProcessOrder.field_process_order));
          jDesktopPane1.add(jTextFieldProcessOrder);
          jTextFieldProcessOrder.setBounds(147, 33, 119, 21);
          jTextFieldProcessOrder.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_PALLET_EDIT_PROCESS_ORDER"));
          jTextFieldProcessOrder.addKeyListener(new KeyAdapter() {
            public void keyReleased(KeyEvent evt) {
              processOrderChanged();
            }
          });
        }
        {
          jButtonLookupProcessOrder = new JButton4j(Common.icon_lookup);
          jDesktopPane1.add(jButtonLookupProcessOrder);
          jButtonLookupProcessOrder.setBounds(266, 33, 21, 21);
          jButtonLookupProcessOrder.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_PALLET_EDIT_PROCESS_ORDER"));
          jButtonLookupProcessOrder.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              JLaunchLookup.dlgCriteriaDefault = "Ready";
              JLaunchLookup.dlgAutoExec = true;
              if (JLaunchLookup.processOrders()) {
                jTextFieldProcessOrder.setText(JLaunchLookup.dlgResult);
                processOrderChanged();
              }
            }
          });
        }
        {
          jLabel6 = new JLabel4j_std();
          jDesktopPane1.add(jLabel6);
          jLabel6.setText(lang.get("lbl_Material_UOM_EAN"));
          jLabel6.setHorizontalAlignment(SwingConstants.RIGHT);
          jLabel6.setHorizontalTextPosition(SwingConstants.RIGHT);
          jLabel6.setBounds(7, 335, 133, 21);
        }
        {
          jTextFieldLayers = new JTextField4j();
          jTextFieldLayers.setFocusCycleRoot(true);
          jTextFieldLayers.setEnabled(false);
          jTextFieldLayers.setBounds(147, 308, 32, 21);
          jDesktopPane1.add(jTextFieldLayers);
        }
        {
          lblLayers = new JLabel4j_std();
          lblLayers.setText(lang.get("lbl_Pallet_Layers"));
          lblLayers.setHorizontalTextPosition(SwingConstants.RIGHT);
          lblLayers.setHorizontalAlignment(SwingConstants.RIGHT);
          lblLayers.setBounds(7, 308, 133, 21);
          jDesktopPane1.add(lblLayers);
        }
        {
          jTextFieldEAN = new JTextField4j();
          jDesktopPane1.add(jTextFieldEAN);
          jTextFieldEAN.setBounds(147, 335, 111, 21);
          jTextFieldEAN.setFocusCycleRoot(true);
          jTextFieldEAN.setEnabled(false);
        }
        {
          jLabel7 = new JLabel4j_std();
          jDesktopPane1.add(jLabel7);
          jLabel7.setText(lang.get("lbl_Material_UOM_Variant"));
          jLabel7.setHorizontalAlignment(SwingConstants.RIGHT);
          jLabel7.setHorizontalTextPosition(SwingConstants.RIGHT);
          jLabel7.setBounds(266, 335, 74, 21);
        }
        {
          jTextFieldVariant = new JTextField4j();
          jDesktopPane1.add(jTextFieldVariant);
          jTextFieldVariant.setBounds(352, 335, 32, 21);
          jTextFieldVariant.setFocusCycleRoot(true);
          jTextFieldVariant.setEnabled(false);
        }
        {
          jLabelQuantity = new JLabel4j_std();
          jDesktopPane1.add(jLabelQuantity);
          jLabelQuantity.setText(lang.get("lbl_Pallet_Quantity"));
          jLabelQuantity.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabelQuantity.setBounds(7, 253, 133, 21);
        }
        {
          jFormattedTextFieldQuantity = new JQuantityInput(new BigDecimal("0"));
          jDesktopPane1.add(jFormattedTextFieldQuantity);
          jFormattedTextFieldQuantity.setFont(Common.font_std);
          jFormattedTextFieldQuantity.setHorizontalAlignment(SwingConstants.TRAILING);
          jFormattedTextFieldQuantity.setBounds(147, 253, 91, 21);
          jFormattedTextFieldQuantity.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_PALLET_EDIT_QUANTITY"));
          jFormattedTextFieldQuantity.addKeyListener(new KeyAdapter() {
            public void keyReleased(KeyEvent evt) {
              jButtonSave.setEnabled(true);
              jButtonUndo.setEnabled(true);
            }
          });

        }
        {
          jLabelDespatchNo = new JLabel4j_std();
          jDesktopPane1.add(jLabelDespatchNo);
          jLabelDespatchNo.setText(lang.get("lbl_Despatch_No"));
          jLabelDespatchNo.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabelDespatchNo.setBounds(7, 444, 133, 25);
        }
        {
          jLabelProductionDate = new JLabel4j_std();
          jDesktopPane1.add(jLabelProductionDate);
          jLabelProductionDate.setText(lang.get("lbl_Pallet_DOM"));
          jLabelProductionDate.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabelProductionDate.setBounds(7, 416, 133, 25);
        }
        {
          productionDate = new JDateControl();
          jDesktopPane1.add(productionDate);
          productionDate.setBounds(147, 416, 125, 25);
          productionDate.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_PALLET_EDIT_PROD_DATE"));

        }

        productionDate.getEditor().addKeyListener(new KeyAdapter() {
          public void keyPressed(KeyEvent e) {
            jButtonSave.setEnabled(true);
            jButtonUndo.setEnabled(true);
          }
        });

        productionDate.addChangeListener(new ChangeListener() {
          public void stateChanged(final ChangeEvent e)

          {
            jButtonSave.setEnabled(true);
            jButtonUndo.setEnabled(true);
          }
        });

        {
          jTextFieldProcessOrderDescription = new JTextField4j();
          jDesktopPane1.add(jTextFieldProcessOrderDescription);
          jTextFieldProcessOrderDescription.setBounds(147, 60, 287, 21);
          jTextFieldProcessOrderDescription.setEnabled(false);
        }
        {
          jLabel8 = new JLabel4j_std();
          jDesktopPane1.add(jLabel8);
          jLabel8.setText(lang.get("lbl_Description"));
          jLabel8.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel8.setBounds(7, 60, 133, 21);
        }
        {
          jLabel9 = new JLabel4j_std();
          jDesktopPane1.add(jLabel9);
          jLabel9.setText(lang.get("lbl_Description"));
          jLabel9.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel9.setBounds(7, 114, 133, 21);
        }
        {
          jTextFieldMaterialDescription = new JTextField4j();
          jTextFieldMaterialDescription.setEditable(false);
          jDesktopPane1.add(jTextFieldMaterialDescription);
          jTextFieldMaterialDescription.setBounds(147, 114, 287, 21);
          jTextFieldMaterialDescription.setEnabled(false);
          jTextFieldMaterialDescription.addKeyListener(new KeyAdapter() {
            public void keyReleased(KeyEvent evt) {
              jButtonSave.setEnabled(true);
              jButtonUndo.setEnabled(true);
            }
          });
        }
        {
          jLabel10 = new JLabel4j_std();
          jDesktopPane1.add(jLabel10);
          jLabel10.setText(lang.get("lbl_Material_Batch_Status"));
          jLabel10.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel10.setBounds(7, 168, 133, 21);
        }
        {
          jTextFieldBatchStatus = new JTextField4j();
          jDesktopPane1.add(jTextFieldBatchStatus);
          jTextFieldBatchStatus.setBounds(147, 168, 119, 21);
          jTextFieldBatchStatus.setEnabled(false);
          jTextFieldBatchStatus.addKeyListener(new KeyAdapter() {
            public void keyReleased(KeyEvent evt) {
              jButtonSave.setEnabled(true);
              jButtonUndo.setEnabled(true);
            }
          });
        }
        {
          expiryDate = new JDateControl();
          expiryDate.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
              jButtonSave.setEnabled(true);
              jButtonUndo.setEnabled(true);
            }
          });

          jDesktopPane1.add(expiryDate);
          expiryDate.setEnabled(false);
          expiryDate.setBounds(147, 195, 125, 25);
          expiryDate.getEditor().setPreferredSize(new java.awt.Dimension(87, 19));
          expiryDate.getEditor().setSize(87, 21);
        }
        {
          jLabelBatchExpiry = new JLabel4j_std();
          jDesktopPane1.add(jLabelBatchExpiry);
          jLabelBatchExpiry.setText(lang.get("lbl_Material_Batch_Expiry_Date"));
          jLabelBatchExpiry.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabelBatchExpiry.setBounds(7, 199, 133, 21);
        }
        {
          jStatusText = new JLabel4j_std();
          jDesktopPane1.add(jStatusText);
          jStatusText.setForeground(new java.awt.Color(255, 0, 0));
          jStatusText.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
          jStatusText.setBounds(0, 535, 455, 21);
        }
        {
          jButton1 = new JButton4j(Common.icon_lookup);
          jDesktopPane1.add(jButton1);
          jButton1.setBounds(266, 168, 21, 21);
          jButton1.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MATERIAL_BATCH_EDIT"));
          jButton1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              JLaunchMenu.runForm("FRM_ADMIN_MATERIAL_BATCH_EDIT", jTextFieldMaterial.getText(), jTextFieldBatch.getText());
            }
          });
        }
        {
          jButtonEditBatch = new JButton4j(Common.icon_edit);
          jDesktopPane1.add(jButtonEditBatch);
          jButtonEditBatch.setBounds(278, 195, 21, 25);
          jButtonEditBatch.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MATERIAL_BATCH_EDIT"));
          jButtonEditBatch.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              JLaunchMenu.runForm("FRM_ADMIN_MATERIAL_BATCH_EDIT", jTextFieldMaterial.getText(), jTextFieldBatch.getText());
            }
          });
        }

        {
          jButtonUndo = new JButton4j(Common.icon_undo);
          jButtonUndo.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              refresh();
            }
          });
          jButtonUndo.setMnemonic(KeyEvent.VK_U);
          jButtonUndo.setText(lang.get("btn_Undo"));
          jButtonUndo.setBounds(116, 502, 111, 28);
          jDesktopPane1.add(jButtonUndo);
        }

        {
          jLabelProductionDate_1 = new JLabel4j_std();
          jLabelProductionDate_1.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabelProductionDate_1.setText(lang.get("lbl_Confirmed"));
          jLabelProductionDate_1.setBounds(7, 470, 133, 24);
          jDesktopPane1.add(jLabelProductionDate_1);
        }

        {

          checkBoxConfirmed.setBackground(Color.WHITE);
          checkBoxConfirmed.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
              jButtonSave.setEnabled(true);
              jButtonUndo.setEnabled(true);
            }
          });
          checkBoxConfirmed.setText("");
          checkBoxConfirmed.setBounds(143, 470, 32, 24);
          jDesktopPane1.add(checkBoxConfirmed);
        }
        {
          calendarButtonproductionDate = new JCalendarButton(productionDate);
          calendarButtonproductionDate.setBounds(275, 418, 21, 21);
          jDesktopPane1.add(calendarButtonproductionDate);
        }
        {
          calendarButtonexpiryDate = new JCalendarButton(expiryDate);
          calendarButtonexpiryDate.setBounds(275, 197, 21, 21);
          calendarButtonexpiryDate.setVisible(false);
          jDesktopPane1.add(calendarButtonexpiryDate);
        }
        {
          JLabel4j_std label = new JLabel4j_std();
          label.setText(lang.get("lbl_Customer_ID"));
          label.setHorizontalAlignment(SwingConstants.TRAILING);
          label.setBounds(12, 362, 128, 21);
          jDesktopPane1.add(label);

          textFieldCustomer = new JTextField4j();
          textFieldCustomer.addKeyListener(new KeyAdapter() {
            public void keyReleased(KeyEvent e) {
              customerIDChanged();
            }
          });
          textFieldCustomer.setBounds(147, 362, 126, 21);
          jDesktopPane1.add(textFieldCustomer);

          JButton4j button = new JButton4j(Common.icon_lookup);
          button.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_CUSTOMER"));
          button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              JLaunchLookup.dlgAutoExec = true;
              JLaunchLookup.dlgCriteriaDefault = "";
              if (JLaunchLookup.customers()) {
                textFieldCustomer.setText(JLaunchLookup.dlgResult);
                customerIDChanged();
              }
            }
          });
          button.setBounds(273, 362, 21, 21);
          jDesktopPane1.add(button);
        }
        {
         
          buttonRefreshMaterialData = new JButton4j(Common.icon_refresh);
          buttonRefreshMaterialData.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
              materialChanged();
            }
          });
View Full Code Here

              }
            }
          }
        }
        {
          jButtonAdd = new JButton4j(Common.icon_add);
          jDesktopPane1.add(jButtonAdd);
          jButtonAdd.setText(lang.get("btn_Add"));
          jButtonAdd.setBounds(212, 10, 125, 30);
          jButtonAdd.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_USER_ADD"));
          jButtonAdd.setMnemonic(lang.getMnemonicChar());
          jButtonAdd.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              add();
            }
          });
        }
        {

          jButtonDelete = new JButton4j(Common.icon_delete);
          jDesktopPane1.add(jButtonDelete);
          jButtonDelete.setText(lang.get("btn_Delete"));
          jButtonDelete.setBounds(212, 41, 125, 30);
          jButtonDelete.setMnemonic(lang.getMnemonicChar());
          jButtonDelete.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_USER_DELETE"));
          jButtonDelete.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              delete();

            }
          });
        }
        {
          jButtonUpdate = new JButton4j(Common.icon_edit);
          jDesktopPane1.add(jButtonUpdate);
          jButtonUpdate.setText(lang.get("btn_Edit"));
          jButtonUpdate.setBounds(212, 72, 125, 30);
          jButtonUpdate.setMnemonic(lang.getMnemonicChar());
          jButtonUpdate.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_USER_EDIT"));
          jButtonUpdate.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              editRecord();
            }
          });
        }
        {
          jButtonClose = new JButton4j(Common.icon_close);
          jDesktopPane1.add(jButtonClose);
          jButtonClose.setText(lang.get("btn_Close"));
          jButtonClose.setBounds(212, 289, 125, 30);
          jButtonClose.setMnemonic(lang.getMnemonicChar());
          jButtonClose.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              dispose();
            }
          });
        }
        {
          jButtonPermissions = new JButton4j(Common.icon_permissions);
          jDesktopPane1.add(jButtonPermissions);
          jButtonPermissions.setText(lang.get("btn_Permissions"));
          jButtonPermissions.setBounds(212, 103, 125, 30);
          jButtonPermissions.setMnemonic(lang.getMnemonicChar());
          jButtonPermissions.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_USER_PERM"));
          jButtonPermissions.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              permissions();
            }
          });
        }
        {

          jButtonPrint = new JButton4j(Common.icon_report);
          jDesktopPane1.add(jButtonPrint);
          jButtonPrint.setText(lang.get("btn_Print"));
          jButtonPrint.setBounds(212, 165, 125, 30);
          jButtonPrint.setMnemonic(lang.getMnemonicChar());
          jButtonPrint.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("RPT_USERS"));
          jButtonPrint.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              print();
            }
          });
        }
        {
          jButtonRename = new JButton4j(Common.icon_rename);
          jDesktopPane1.add(jButtonRename);
          jButtonRename.setText(lang.get("btn_Rename"));
          jButtonRename.setMnemonic(lang.getMnemonicChar());
          jButtonRename.setBounds(212, 134, 125, 30);
          jButtonRename.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_USER_RENAME"));
          jButtonRename.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              rename();
            }
          });
        }
        {
          jButtonHelp = new JButton4j(Common.icon_help);
          jDesktopPane1.add(jButtonHelp);
          jButtonHelp.setText(lang.get("btn_Help"));
          jButtonHelp.setBounds(212, 258, 125, 30);
          jButtonHelp.setMnemonic(lang.getMnemonicChar());
        }
        {
          jButtonRefresh = new JButton4j(Common.icon_refresh);
          jDesktopPane1.add(jButtonRefresh);
          jButtonRefresh.setText(lang.get("btn_Refresh"));
          jButtonRefresh.setBounds(212, 196, 125, 30);
          jButtonRefresh.setMnemonic(lang.getMnemonicChar());
          jButtonRefresh.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              populateList("");
            }
          });
        }

        {
          jButtonExcel = new JButton4j(Common.icon_XLS);
          jButtonExcel.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
              excel();

            }
View Full Code Here

              jButtonUpdate.setEnabled(true);
            }
          });
        }
        {
          jButtonUpdate = new JButton4j(Common.icon_update);
          jDesktopPane1.add(jButtonUpdate);
          jButtonUpdate.setEnabled(false);
          jButtonUpdate.setText(lang.get("btn_Save"));
          jButtonUpdate.setMnemonic(lang.getMnemonicChar());
          jButtonUpdate.setHorizontalTextPosition(SwingConstants.RIGHT);
          jButtonUpdate.setBounds(45, 142, 110, 30);
          jButtonUpdate.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              uom.setIsoUom(jTextFieldISO_UOM.getText().toUpperCase());
              uom.setDescription(jTextFieldDescription.getText().toUpperCase());
              uom.setLocalUom(jTextFieldLocal_UOM.getText().toUpperCase());
              uom.update();
              jButtonUpdate.setEnabled(false);
            }
          });
        }
        {
          jButtonHelp = new JButton4j(Common.icon_help);
          jDesktopPane1.add(jButtonHelp);
          jButtonHelp.setText(lang.get("btn_Help"));
          jButtonHelp.setMnemonic(lang.getMnemonicChar());
          jButtonHelp.setBounds(157, 142, 110, 30);
        }
        {
          jButtonClose = new JButton4j(Common.icon_close);
          jDesktopPane1.add(jButtonClose);
          jButtonClose.setText(lang.get("btn_Close"));
          jButtonClose.setMnemonic(lang.getMnemonicChar());
          jButtonClose.setBounds(269, 142, 110, 30);
          jButtonClose.addActionListener(new ActionListener() {
View Full Code Here

              popupMenu.add(newItemMenuItem);
            }
          }
        }
        {
          jButtonAdd = new JButton4j(Common.icon_add);
          jDesktopPane1.add(jButtonAdd);
          jButtonAdd.setText(lang.get("btn_Add"));
          jButtonAdd.setBounds(183, 10, 125, 30);
          jButtonAdd.setMnemonic(lang.getMnemonicChar());
          jButtonAdd.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_GROUP_ADD"));
          jButtonAdd.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              addRecord();
            }
          });
        }
        {
          jButtonDelete = new JButton4j(Common.icon_delete);
          jDesktopPane1.add(jButtonDelete);
          jButtonDelete.setText(lang.get("btn_Delete"));
          jButtonDelete.setBounds(183, 41, 125, 30);
          jButtonDelete.setMnemonic(lang.getMnemonicChar());
          jButtonDelete.setFocusTraversalKeysEnabled(false);
          jButtonDelete.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_GROUP_DELETE"));
          jButtonDelete.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              delete();
            }
          });
        }
        {
          jButtonEdit = new JButton4j(Common.icon_edit);
          jDesktopPane1.add(jButtonEdit);
          jButtonEdit.setText(lang.get("btn_Edit"));
          jButtonEdit.setBounds(183, 72, 125, 30);
          jButtonEdit.setMnemonic(lang.getMnemonicChar());
          jButtonEdit.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_GROUP_EDIT"));
          jButtonEdit.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              edit();
            }
          });
        }
        {
          jButtonPermissions = new JButton4j(Common.icon_permissions);
          jDesktopPane1.add(jButtonPermissions);
          jButtonPermissions.setText(lang.get("btn_Permissions"));
          jButtonPermissions.setBounds(183, 103, 125, 30);
          jButtonPermissions.setMnemonic(lang.getMnemonicChar());
          jButtonPermissions.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_GROUP_PERM"));
          jButtonPermissions.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              permissions();
            }
          });
        }
        {
          jButtonClose = new JButton4j(Common.icon_close);
          jDesktopPane1.add(jButtonClose);
          jButtonClose.setText(lang.get("btn_Close"));
          jButtonClose.setBounds(183, 258, 125, 30);
          jButtonClose.setMnemonic(lang.getMnemonicChar());
          jButtonClose.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              dispose();
            }
          });
        }
        {
          jButtonPrint = new JButton4j(Common.icon_report);
          jDesktopPane1.add(jButtonPrint);
          jButtonPrint.setText(lang.get("btn_Print"));
          jButtonPrint.setBounds(183, 165, 125, 30);
          jButtonPrint.setMnemonic(lang.getMnemonicChar());
          jButtonPrint.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("RPT_GROUPS"));
          jButtonPrint.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              print();
            }
          });
        }
        {
          jButtonRename = new JButton4j(Common.icon_rename);
          jDesktopPane1.add(jButtonRename);
          jButtonRename.setText(lang.get("btn_Rename"));
          jButtonRename.setMnemonic(lang.getMnemonicChar());
          jButtonRename.setBounds(183, 134, 125, 30);
          jButtonRename.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_GROUP_RENAME"));
          jButtonRename.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              rename();
            }
          });
        }
        {
          jButtonHelp = new JButton4j(Common.icon_help);
          jDesktopPane1.add(jButtonHelp);
          jButtonHelp.setText(lang.get("btn_Help"));
          jButtonHelp.setBounds(183, 196, 125, 30);
          jButtonHelp.setMnemonic(lang.getMnemonicChar());
        }
        {
          jButtonRefresh = new JButton4j(Common.icon_refresh);
          jDesktopPane1.add(jButtonRefresh);
          jButtonRefresh.setText(lang.get("btn_Refresh"));
          jButtonRefresh.setBounds(183, 227, 125, 30);
          jButtonRefresh.setMnemonic(lang.getMnemonicChar());
          jButtonRefresh.addActionListener(new ActionListener() {
View Full Code Here

          jDesktopPane1.add(jLabelAvailable);
          jLabelAvailable.setText(lang.get("lbl_Unassigned"));
          jLabelAvailable.setBounds(355, 0, 70, 21);
        }
        {
          jButtonAssign = new JButton4j(Common.icon_arrow_left);
          jDesktopPane1.add(jButtonAssign);
          jButtonAssign.setBounds(322, 154, 26, 24);
          jButtonAssign.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              if (jListUnassigned.getSelectedIndex() > -1)
              {
                for (int j = jListUnassigned.getMaxSelectionIndex(); j >= jListUnassigned.getMinSelectionIndex(); j--)
                {
                  if (jListUnassigned.isSelectedIndex(j))
                  {
                    JDBListData item = (JDBListData) jListUnassigned.getModel().getElementAt(j);
                    addToList(assignedGroupList, item);
                    removeFromList(unAssignedGroupList, item);
                  }
                }
                populateAssignedList();
                populateUnAssignedList();
                setButtonState();
              }
            }
          });
        }
        {
          jButtonUnAssign = new JButton4j(Common.icon_arrow_right);
          jDesktopPane1.add(jButtonUnAssign);
          jButtonUnAssign.setBounds(322, 182, 26, 24);
          jButtonUnAssign.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              if (jListAssigned.getSelectedIndex() > -1)
              {
                for (int j = jListAssigned.getMaxSelectionIndex(); j >= jListAssigned.getMinSelectionIndex(); j--)
                {
                  if (jListAssigned.isSelectedIndex(j))
                  {
                    JDBListData item = (JDBListData) jListAssigned.getModel().getElementAt(j);
                    addToList(unAssignedGroupList, item);
                    removeFromList(assignedGroupList, item);
                  }
                }
                populateAssignedList();
                populateUnAssignedList();
                setButtonState();
              }
            }
          });
        }
        {
          jScrollPaneUnassigned = new JScrollPane();
          jDesktopPane1.add(jScrollPaneUnassigned);
          jScrollPaneUnassigned.setBounds(357, 21, 301, 371);
          jScrollPaneUnassigned.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
          jScrollPaneUnassigned.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
          {
            ListModel jListUnassignedModel = new DefaultComboBoxModel(new String[] { "Item One", "Item Two" });
            jListUnassigned = new JDBModuleJList(Common.selectedHostID, Common.sessionID);
            jScrollPaneUnassigned.setViewportView(jListUnassigned);
            jListUnassigned.setModel(jListUnassignedModel);
            jListUnassigned.setCellRenderer(Common.renderer_list_unassigned);
            jListUnassigned.setBackground(Common.color_list_unassigned);
          }
        }
        {
          jScrollPaneAssigned = new JScrollPane();
          jDesktopPane1.add(jScrollPaneAssigned);
          jScrollPaneAssigned.setBounds(14, 21, 301, 371);
          jScrollPaneAssigned.setFocusable(false);
          jScrollPaneAssigned.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
          jScrollPaneAssigned.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
          {
            ListModel jListAssignedModel = new DefaultComboBoxModel(new String[] { "Item One", "Item Two" });
            jListAssigned = new JDBModuleJList(Common.selectedHostID, Common.sessionID);
            jScrollPaneAssigned.setViewportView(jListAssigned);
            jListAssigned.setCellRenderer(Common.renderer_list_assigned);
            jListAssigned.setBackground(Common.color_list_assigned);
            jListAssigned.setModel(jListAssignedModel);
            jListAssigned.setForeground(Common.color_listFontStandard);
          }
        }
        {
          jButtonUndo = new JButton4j(Common.icon_undo);
          jDesktopPane1.add(jButtonUndo);
          jButtonUndo.setText(lang.get("btn_Undo"));
          jButtonUndo.setBounds(112, 399, 112, 28);
          jButtonUndo.setMnemonic(lang.getMnemonicChar());
          jButtonUndo.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              resetLists();
            }
          });
        }
        {
          jButtonSave = new JButton4j(Common.icon_update);
          jDesktopPane1.add(jButtonSave);
          jButtonSave.setText(lang.get("btn_Save"));
          jButtonSave.setBounds(224, 399, 112, 28);
          jButtonSave.setMnemonic(lang.getMnemonicChar());
          jButtonSave.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              JDBGroup group = new JDBGroup(Common.selectedHostID, Common.sessionID);
              group.setGroupId(lGroupId);
              for (int j = 0; j < unAssignedGroupList.size(); j++)
              {
                group.removeModule(unAssignedGroupList.get(j).toString());
              }
              for (int j = 0; j < assignedGroupList.size(); j++)
              {
                group.addModule(assignedGroupList.get(j).toString());
              }
              jButtonUndo.setEnabled(false);
              jButtonSave.setEnabled(false);
            }
          });
        }
        {
          jButtonClose = new JButton4j(Common.icon_close);
          jDesktopPane1.add(jButtonClose);
          jButtonClose.setText(lang.get("btn_Close"));
          jButtonClose.setBounds(448, 399, 112, 28);
          jButtonClose.setMnemonic(lang.getMnemonicChar());
          jButtonClose.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              dispose();
            }
          });
        }
        {
          jButtonHelp = new JButton4j(Common.icon_help);
          jDesktopPane1.add(jButtonHelp);
          jButtonHelp.setText(lang.get("btn_Help"));
          jButtonHelp.setBounds(336, 399, 112, 28);
          jButtonHelp.setMnemonic(lang.getMnemonicChar());
        }
View Full Code Here

    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    Rectangle window = getBounds();
    setLocation((screen.width - window.width) / 2, (screen.height - window.height) / 2);

    {
      jButtonExcel = new JButton4j(Common.icon_XLS);
      jButtonExcel.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
          JDBControl control = new JDBControl(Common.selectedHostID, Common.sessionID);

          JExcel export = new JExcel();
View Full Code Here

        }

      }
      {
        jButtonEdit = new JButton4j(Common.icon_edit);
        this.getContentPane().add(jButtonEdit);
        jButtonEdit.setText(lang.get("btn_Edit"));
        jButtonEdit.setBounds(115, 275, 106, 30);
        jButtonEdit.setMnemonic(lang.getMnemonicChar());
        jButtonEdit.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_SYSTEM_KEYS_EDIT"));
        jButtonEdit.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            editRecord();
          }
        });
      }
      {
        jButtonClose = new JButton4j(Common.icon_close);
        this.getContentPane().add(jButtonClose);
        jButtonClose.setText(lang.get("btn_Close"));
        jButtonClose.setBounds(655, 275, 106, 30);
        jButtonClose.setMnemonic(lang.getMnemonicChar());
        jButtonClose.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            jButtonCloseActionPerformed(evt);
          }
        });
      }
      {

        jButtonAdd = new JButton4j(Common.icon_add);
        this.getContentPane().add(jButtonAdd);
        jButtonAdd.setText(lang.get("btn_Add"));
        jButtonAdd.setBounds(7, 275, 106, 30);
        jButtonAdd.setMnemonic(lang.getMnemonicChar());
        jButtonAdd.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_SYSTEM_KEYS_ADD"));
        jButtonAdd.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            JDBControl ctl = new JDBControl(Common.selectedHostID, Common.sessionID);

            systemKey = JOptionPane.showInputDialog(Common.mainForm, "Enter new System Key");
            if (systemKey != null)
            {
              if (systemKey.equals("") == false)
              {
                systemKey = systemKey.toUpperCase();
                if (ctl.create(systemKey, "", "") == false)
                {
                  JUtility.errorBeep();
                  JOptionPane.showMessageDialog(Common.mainForm, ctl.getErrorMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
                else
                {

                  populateList("");
                  JLaunchMenu.runDialog("FRM_ADMIN_CONTROL_EDIT", systemKey);
                  populateList("");
                }
              }
            }

          }
        });
      }
      {
        jButtonDelete = new JButton4j(Common.icon_delete);
        this.getContentPane().add(jButtonDelete);
        jButtonDelete.setText(lang.get("btn_Delete"));
        jButtonDelete.setBounds(223, 275, 106, 30);
        jButtonDelete.setMnemonic(lang.getMnemonicChar());
        jButtonDelete.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_SYSTEM_KEYS_DELETE"));
        jButtonDelete.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            int row = jTable1.getSelectedRow();
            if (row >= 0)
            {

              systemKey = jTable1.getValueAt(row, 0).toString();

              int n = JOptionPane.showConfirmDialog(Common.mainForm, "Delete System Key " + systemKey + " ?", "Confirm", JOptionPane.YES_NO_OPTION);
              if (n == 0)
              {
                JDBControl c = new JDBControl(Common.selectedHostID, Common.sessionID);
                c.setSystemKey(systemKey);
                c.delete();
                populateList("");
              }
            }
          }
        });
      }
      {
        jButtonPrint = new JButton4j(Common.icon_report);
        this.getContentPane().add(jButtonPrint);
        jButtonPrint.setText(lang.get("btn_Print"));
        jButtonPrint.setBounds(439, 275, 106, 30);
        jButtonPrint.setMnemonic(lang.getMnemonicChar());
        jButtonPrint.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("RPT_CONTROL"));
        jButtonPrint.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            JLaunchReport.runReport("RPT_CONTROL",null,"",null,"");
          }
        });
      }
      {
        jButtonHelp = new JButton4j(Common.icon_help);
        this.getContentPane().add(jButtonHelp);
        jButtonHelp.setText(lang.get("btn_Help"));
        jButtonHelp.setBounds(547, 275, 106, 30);
        jButtonHelp.setMnemonic(lang.getMnemonicChar());
View Full Code Here

TOP

Related Classes of com.commander4j.gui.JButton4j

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.