Package com.commander4j.gui

Examples of com.commander4j.gui.JButton4j


        {
          getHostDataTo();
        }
      });

      jButtonClone = new JButton4j(Common.icon_clone);
      desktopPane.add(jButtonClone);
      jButtonClone.setText("Clone Database");
      jButtonClone.setBounds(129, 444, 160, 36);
      jButtonClone.addActionListener(new ActionListener()
      {
        public void actionPerformed(ActionEvent evt)
        {

          String schemaFrom = "";
          String schemaTo = "";
          JDBControl ctrl;

          // Source & Destination must be different Hosts//
          setStatusBarText("Validating selected hosts");
          if (hostIDFrom.equals(hostIDTo) == false)
          {

            // Check we can connect to Source //
            setStatusBarText("Connecting to source...");
            if (hstFrom.connect(sessionFrom, hostIDFrom))
            {
             
              // Check we can connect to Destination //
              setStatusBarText("Connecting to destination...");
              if (hstTo.connect(sessionTo, hostIDTo))
              {

                // Check Application Schema Versions are the
                // same in Source and Destination //
                setStatusBarText("Checking schema versions...");
                ctrl = new JDBControl(hostIDFrom, sessionFrom);
                schemaFrom = ctrl.getKeyValue("SCHEMA VERSION");
                ctrl = new JDBControl(hostIDTo, sessionTo);
                schemaTo = ctrl.getKeyValue("SCHEMA VERSION");

                if (schemaFrom.equals(schemaTo))
                {
                  // OK //
                  setStatusBarText("Getting source table names...");
                  int tableCountFrom = 0;
                  JDBStructure strucFrom = new JDBStructure(hostIDFrom, sessionFrom);
                  LinkedList<String> tablesFrom = strucFrom.getTableNames();
                  tableCountFrom = tablesFrom.size();
                  progressBar.setMinimum(1);
                  progressBar.setMaximum(tableCountFrom);

                  setStatusBarText("Getting destination table names...");
                  int tableCountTo = 0;
                  JDBStructure strucTo = new JDBStructure(hostIDTo, sessionTo);
                  LinkedList<String> tablesTo = strucTo.getTableNames();
                  tableCountTo = tablesTo.size();

                  if (tableCountFrom == tableCountTo)
                  {
                    String table = "";
                    for (int tf = 0; tf < tableCountFrom; tf++)
                    {
                      table = tablesFrom.get(tf);
                      progressBar.setValue(tf+1);
                      progressBar.paintImmediately(progressBar.getVisibleRect());
                      if (tablesTo.contains(table))
                      {

                        // GET FIELDS FOR CURRENT TABLE
                        setStatusBarText("Getting field names for "+table);
                        LinkedList<JDBField> fieldNames = strucFrom.getFieldNames(table);
                        JWait.milliSec(100);

                        // CREATE INSERT STATEMENT FOR
                        // TARGET DATABASE //
                        setStatusBarText("Generating insert SQL for "+table);
                        String insertTable = "insert into " + table;
                        String insertFields = "";
                        String insertPlaceMarkers = "";
                        String comma = "";

                        for (int temp = 0; temp < fieldNames.size(); temp++)
                        {
                          if (temp == 0)
                          {
                            comma = "";
                          } else
                          {
                            comma = ",";
                          }
                          insertFields = insertFields + comma + fieldNames.get(temp).getfieldName();
                          insertPlaceMarkers = insertPlaceMarkers + comma + "?";
                        }

                        String insertStatement = insertTable + " (" + insertFields + ") values (" + insertPlaceMarkers + ")";

                        // SELECT ALL SOURCE RECORDS //
                        setStatusBarText("Copying table "+table);
                        Long recordsCopied = (long) 0;
                        try
                        {
                          hstFrom.getConnection(sessionFrom).setAutoCommit(false);
                          hstTo.getConnection(sessionTo).setAutoCommit(false);
                          PreparedStatement truncateData = hstTo.getConnection(sessionTo).prepareStatement("truncate table " + table);
                          PreparedStatement destinationData = hstTo.getConnection(sessionTo).prepareStatement(insertStatement);
                          PreparedStatement sourceData = hstFrom.getConnection(sessionFrom).prepareStatement("select * from " + table);
                          sourceData.setFetchDirection(ResultSet.FETCH_FORWARD);
                          destinationData.setFetchDirection(ResultSet.FETCH_FORWARD);
                          sourceData.setFetchSize(1);
                          destinationData.setFetchSize(1);
                          truncateData.setFetchSize(1);
                          ResultSet sourceResultset = sourceData.executeQuery();

                          truncateData.execute();
                          truncateData.close();
                          truncateData = null;


                          while (sourceResultset.next())
                          {
                            for (int fldfrom = 0; fldfrom < fieldNames.size(); fldfrom++)
                            {
                              JDBField field = fieldNames.get(fldfrom);
                              if (field.getfieldType().toLowerCase().equals("varchar"))
                              {
                                String value;
                                value = sourceResultset.getString(field.getfieldName());
                                destinationData.setString(fldfrom + 1, value);
                                //System.out.println("Table = \"" + table + "\" Field = \"" + field.getfieldName() + "\" Value = \"" + value + "\"");
                              }
                              if ((field.getfieldType().toLowerCase().equals("decimal")) | (field.getfieldType().toLowerCase().equals("numeric")) | (field.getfieldType().toLowerCase().equals("float")))
                              {
                                BigDecimal value;
                                value = sourceResultset.getBigDecimal(field.getfieldName());
                                destinationData.setBigDecimal(fldfrom + 1, value);
                                //System.out.println("Table = \"" + table + "\" Field = \"" + field.getfieldName() + "\" Value = \"" + JUtility.replaceNullObjectwithBlank(value).toString() + "\"");
                              }
                              if (field.getfieldType().toLowerCase().equals("datetime"))
                              {
                                Timestamp value;
                                value = sourceResultset.getTimestamp(field.getfieldName());
                                destinationData.setTimestamp(fldfrom + 1, value);
                                //System.out.println("Table = \"" + table + "\" Field = \"" + field.getfieldName() + "\" Value = \""
                                //    + JUtility.replaceNullObjectwithBlank(value).toString() + "\"");
                              }
                              if ((field.getfieldType().toLowerCase().equals("int")) | (field.getfieldType().toLowerCase().equals("bigint")))
                              {
                                Integer value;
                                value = sourceResultset.getInt(field.getfieldName());
                                destinationData.setInt(fldfrom + 1, value);
                                //System.out.println("Table = \"" + table + "\" Field = \"" + field.getfieldName() + "\" Value = \""
                                //    + JUtility.replaceNullObjectwithBlank(value).toString() + "\"");
                              }
                              field=null;
                            }
                            try
                            {
                              destinationData.execute();
                              hstTo.getConnection(sessionTo).commit();
                              destinationData.clearParameters();
                              recordsCopied++;
                             
                            } catch (Exception ex)
                            {
                              System.out.println(ex.getMessage());
                            }
                          }

                          sourceResultset.close();
                          sourceResultset = null;
                          destinationData.close();
                          destinationData = null;
                          sourceData.close();
                          sourceData = null;
                          setStatusBarText("Copying complete");

                        } catch (SQLException e)
                        {
                          labelCommand.setText("Error reading "+table);
                        }

                      } else
                      {
                        labelCommand.setText("Table "+table+" does not exist in destination");
                      }

                    }
                  } else
                  {
                   
                    labelCommand.setText("Number of tables mismatch "+String.valueOf(tableCountFrom)+"/"+String.valueOf(tableCountTo));
                  }

                } else
                {
                  labelCommand.setText("Schema version mismatch "+String.valueOf(schemaFrom)+"/"+String.valueOf(schemaTo));
                }

              } else
              {
                labelCommand.setText("Cannot connect to destination.");
              }
              hstFrom.disconnect(Common.sessionID);
            } else
            {
              labelCommand.setText("Cannot connect to source.");
            }
          } else
          {
            labelCommand.setText("Cannot clone to self.");
          }
        }
      });

      jButtonClose = new JButton4j(Common.icon_close);
      desktopPane.add(jButtonClose);
      jButtonClose.setText("Close");
      jButtonClose.setBounds(293, 444, 160, 36);
      jButtonClose.addActionListener(new ActionListener()
      {
View Full Code Here


    desktopPane.add(textFieldInspectionDescription);
    textFieldInspectionDescription.setColumns(10);
   

   
    btnSave = new JButton4j(lang.get("btn_Save"));
    btnSave.setEnabled(false);
    btnSave.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        save();
      }
    });
    btnSave.setIcon(Common.icon_save);
    btnSave.setBounds(293, 75, 117, 29);
    desktopPane.add(btnSave);
   
    btnClose = new JButton4j(lang.get("btn_Close"));
    btnClose.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        dispose();
      }
    });
View Full Code Here

              }
            }
          }
        }
        {
          jButtonAdd = new JButton4j(Common.icon_add);
          jDesktopPane1.add(jButtonAdd);
          jButtonAdd.setText(lang.get("btn_Add"));
          jButtonAdd.setMnemonic(lang.getMnemonicChar());
          jButtonAdd.setBounds(384, 10, 126, 28);
          jButtonAdd.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MODULE_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.setMnemonic(lang.getMnemonicChar());
          jButtonDelete.setBounds(384, 38, 126, 28);
          jButtonDelete.setFocusTraversalKeysEnabled(false);
          jButtonDelete.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MODULE_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.setMnemonic(lang.getMnemonicChar());
          jButtonEdit.setBounds(384, 66, 126, 28);
          jButtonEdit.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MODULE_EDIT"));
          jButtonEdit.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              editRecord();
            }
          });
        }
        {
          jButtonPrint = new JButton4j(Common.icon_report);
          jDesktopPane1.add(jButtonPrint);
          jButtonPrint.setText(lang.get("btn_Print"));
          jButtonPrint.setMnemonic(lang.getMnemonicChar());
          jButtonPrint.setBounds(384, 121, 126, 28);
          jButtonPrint.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("RPT_MODULES"));
          jButtonPrint.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              print();
            }
          });
        }
        {
          jButtonClose = new JButton4j(Common.icon_close);
          jDesktopPane1.add(jButtonClose);
          jButtonClose.setText(lang.get("btn_Close"));
          jButtonClose.setMnemonic(lang.getMnemonicChar());
          jButtonClose.setBounds(384, 233, 126, 28);
          jButtonClose.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              dispose();
            }
          });
        }
        {
          jButtonRename = new JButton4j(Common.icon_rename);
          jDesktopPane1.add(jButtonRename);
          jButtonRename.setText(lang.get("btn_Rename"));
          jButtonRename.setMnemonic(lang.getMnemonicChar());
          jButtonRename.setBounds(384, 94, 126, 28);
          jButtonRename.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_ADMIN_MODULE_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(384, 177, 126, 28);
          jButtonHelp.setMnemonic(lang.getMnemonicChar());
        }
        {
          jButton1 = new JButton4j(Common.icon_refresh);
          jDesktopPane1.add(jButton1);
          jButton1.setText(lang.get("btn_Refresh"));
          jButton1.setBounds(384, 205, 126, 28);
          jButton1.setMnemonic(lang.getMnemonicChar());
          jButton1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              populateList("");
            }
          });
        }
        {
          jRadioButtonAll = new JRadioButton();
          jDesktopPane1.add(jRadioButtonAll);
          jRadioButtonAll.setText(lang.get("lbl_Module_ALL"));
          jRadioButtonAll.setBounds(384, 277, 168, 28);
          jRadioButtonAll.setFont(Common.font_bold);
          buttonGroup1.add(jRadioButtonAll);
          jRadioButtonAll.setBackground(new java.awt.Color(255, 255, 255));
          jRadioButtonAll.setSelected(true);
          jRadioButtonAll.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              selectedModuleType = "ALL";
              jRadioButtonActionPerformed(evt);
            }
          });
        }
        {
          jRadioButtonForms = new JRadioButton();
          jDesktopPane1.add(jRadioButtonForms);
          jRadioButtonForms.setText(lang.get("lbl_Module_Form"));
          jRadioButtonForms.setBounds(384, 305, 168, 28);
          jRadioButtonForms.setFont(Common.font_bold);
          buttonGroup1.add(jRadioButtonForms);
          jRadioButtonForms.setBackground(new java.awt.Color(255, 255, 255));
          jRadioButtonForms.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              selectedModuleType = "FORM";
              jRadioButtonActionPerformed(evt);
            }
          });
        }
        {
          jRadioButtonFunctions = new JRadioButton();
          jDesktopPane1.add(jRadioButtonFunctions);
          jRadioButtonFunctions.setText(lang.get("lbl_Module_Function"));
          jRadioButtonFunctions.setFont(Common.font_bold);
          jRadioButtonFunctions.setBounds(384, 333, 168, 28);
          buttonGroup1.add(jRadioButtonFunctions);
          jRadioButtonFunctions.setBackground(new java.awt.Color(255, 255, 255));
          jRadioButtonFunctions.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              selectedModuleType = "FUNCTION";
              jRadioButtonActionPerformed(evt);
            }
          });
        }
        {
          jRadioButtonMenus = new JRadioButton();
          jDesktopPane1.add(jRadioButtonMenus);
          jRadioButtonMenus.setText(lang.get("lbl_Module_Menu"));
          jRadioButtonMenus.setFont(Common.font_bold);
          jRadioButtonMenus.setBounds(384, 361, 168, 28);
          buttonGroup1.add(jRadioButtonMenus);
          jRadioButtonMenus.setBackground(new java.awt.Color(255, 255, 255));
          jRadioButtonMenus.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              selectedModuleType = "MENU";
              jRadioButtonActionPerformed(evt);
            }
          });
        }
        {
          jRadioButtonReports = new JRadioButton();
          jDesktopPane1.add(jRadioButtonReports);
          jRadioButtonReports.setText(lang.get("lbl_Module_Report"));
          jRadioButtonReports.setFont(Common.font_bold);
          jRadioButtonReports.setBounds(384, 389, 168, 28);
          buttonGroup1.add(jRadioButtonReports);
          jRadioButtonReports.setBackground(new java.awt.Color(255, 255, 255));
          jRadioButtonReports.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              selectedModuleType = "REPORT";
              jRadioButtonActionPerformed(evt);
            }
          });
        }
        {
          jRadioButtonUserReports = new JRadioButton();
          jDesktopPane1.add(jRadioButtonUserReports);
          jRadioButtonUserReports.setText(lang.get("lbl_Module_UserReport"));
          jRadioButtonUserReports.setFont(Common.font_bold);
          jRadioButtonUserReports.setBounds(384, 445, 168, 28);
          buttonGroup1.add(jRadioButtonUserReports);
          jRadioButtonUserReports.setBackground(new java.awt.Color(255, 255, 255));
          jRadioButtonUserReports.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              selectedModuleType = "USER";
              jRadioButtonActionPerformed(evt);
            }
          });
        }
       
        {
          jRadioButtonExec = new JRadioButton();
          jDesktopPane1.add(jRadioButtonExec);
          jRadioButtonExec.setText(lang.get("lbl_Module_Executable"));
          jRadioButtonExec.setFont(Common.font_bold);
          jRadioButtonExec.setBackground(new java.awt.Color(255, 255, 255));
          jRadioButtonExec.setBounds(384, 417, 168, 28);
          buttonGroup1.add(jRadioButtonExec);
          jRadioButtonExec.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              selectedModuleType = "EXEC";
              jRadioButtonActionPerformed(evt);
            }
          });
        }

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

          jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
          jLabel2.setHorizontalTextPosition(SwingConstants.RIGHT);
        }
        {

          jButtonUpdate = new JButton4j(Common.icon_update);
          jButtonUpdate.setBounds(153, 142, 132, 30);
          jDesktopPane1.add(jButtonUpdate);
          jButtonUpdate.setText(lang.get("btn_Save"));
          jButtonUpdate.setHorizontalTextPosition(SwingConstants.RIGHT);
          jButtonUpdate.setMnemonic(lang.getMnemonicChar());
          jButtonUpdate.setEnabled(false);
          jButtonUpdate.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              language.setText(jTextFieldText.getText());
              language.setMnemonic(JTextFieldMnemonic.getText());
              language.update();
              jButtonUpdate.setEnabled(false);
            }
          });
        }
        {

          jButtonClose = new JButton4j(Common.icon_close);
          jButtonClose.setBounds(424, 142, 132, 30);
          jDesktopPane1.add(jButtonClose);
          jButtonClose.setText(lang.get("btn_Close"));
          jButtonClose.setMnemonic(lang.getMnemonicChar());
          jButtonClose.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              dispose();
            }
          });
        }
        {
          jTextFieldText = new JTextField4j();
          jTextFieldText.setBounds(130, 76, 561, 21);
          jDesktopPane1.add(jTextFieldText);
          AbstractDocument doc = (AbstractDocument) jTextFieldText.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBLanguage.field_Text_size));
          jTextFieldText.setPreferredSize(new java.awt.Dimension(40, 20));
          jTextFieldText.setFocusCycleRoot(true);
          jTextFieldText.addKeyListener(new KeyAdapter() {
            public void keyTyped(KeyEvent evt) {
              jButtonUpdate.setEnabled(true);
            }
          });
        }
        {
          jButtonHelp = new JButton4j(Common.icon_help);
          jButtonHelp.setBounds(288, 142, 132, 30);
          jDesktopPane1.add(jButtonHelp);
          jButtonHelp.setText(lang.get("btn_Help"));
          jButtonHelp.setMnemonic(lang.getMnemonicChar());
        }
View Full Code Here

      jLabel11 = new JLabel4j_std();
      jCheckBoxAccountLocked = new JCheckBox();
      jCheckBoxPasswordExpires = new JCheckBox();
      jCheckBoxPasswordChangeAllowed = new JCheckBox();

      jButtonSave = new JButton4j(Common.icon_update);
      jButtonCancel = new JButton4j(Common.icon_close);

      BorderLayout thisLayout = new BorderLayout();
      this.getContentPane().setLayout(thisLayout);
      thisLayout.setHgap(0);
      thisLayout.setVgap(0);
      this.setTitle("User Properties");
      this.setClosable(true);
      this.setVisible(true);
      this.setPreferredSize(new java.awt.Dimension(417, 432));
      this.setBounds(0, 0, 430+Common.LFAdjustWidth, 479+Common.LFAdjustHeight);
      this.setIconifiable(true);

      jDesktopPane1.setPreferredSize(new java.awt.Dimension(364, 329));
      jDesktopPane1.setOpaque(true);
      this.getContentPane().add(jDesktopPane1, BorderLayout.CENTER);
      jDesktopPane1.setLayout(null);

      jLabel2.setText(lang.get("lbl_Description"));
      jDesktopPane1.add(jLabel2);
      jLabel2.setBounds(0, 35, 158, 20);
      jLabel2.setHorizontalAlignment(SwingConstants.TRAILING);

      jLabel3.setText(lang.get("lbl_User_Account_Password"));
      jDesktopPane1.add(jLabel3);
      jLabel3.setBounds(0, 62, 158, 20);
      jLabel3.setHorizontalAlignment(SwingConstants.TRAILING);

      jLabel1.setText(lang.get("lbl_User_ID"));

      jDesktopPane1.add(jLabel1);
      jLabel1.setFocusTraversalKeysEnabled(false);
      jLabel1.setBounds(0, 7, 158, 20);
      jLabel1.setHorizontalAlignment(SwingConstants.TRAILING);

      jLabel4.setText(lang.get("lbl_User_Account_Password_Verify"));
      jDesktopPane1.add(jLabel4);
      jLabel4.setBounds(0, 89, 158, 20);
      jLabel4.setHorizontalAlignment(SwingConstants.TRAILING);

      jTextFieldUserID.setEditable(false);
      jTextFieldUserID.setEnabled(false);
      jTextFieldUserID.setPreferredSize(new java.awt.Dimension(100, 20));
      jTextFieldUserID.setDisabledTextColor(Common.color_textdisabled);
      jDesktopPane1.add(jTextFieldUserID);
      jTextFieldUserID.setBounds(172, 7, 100, 20);

      AbstractDocument doc = (AbstractDocument) jTextFieldComment.getDocument();
      doc.setDocumentFilter(new JFixedSizeFilter(JDBUser.field_comment));
      jDesktopPane1.add(jTextFieldComment);
      jTextFieldComment.setBounds(172, 34, 217, 21);
      jTextFieldComment.addKeyListener(new KeyAdapter() {
        public void keyTyped(KeyEvent evt) {
          jTextFieldCommentKeyTyped(evt);
        }
      });

      jPasswordField1.setPreferredSize(new java.awt.Dimension(100, 20));
      AbstractDocument doc1 = (AbstractDocument) jPasswordField1.getDocument();
      doc1.setDocumentFilter(new JFixedSizeFilter(JDBUser.field_password));
      jDesktopPane1.add(jPasswordField1);
      jPasswordField1.setBounds(172, 62, 100, 20);
      jPasswordField1.addKeyListener(new KeyAdapter() {
        public void keyTyped(KeyEvent evt) {
          jPasswordField1KeyTyped(evt);
        }
      });

      jPasswordField2.setPreferredSize(new java.awt.Dimension(100, 20));
      AbstractDocument doc2 = (AbstractDocument) jPasswordField2.getDocument();
      doc2.setDocumentFilter(new JFixedSizeFilter(JDBUser.field_password));
      jDesktopPane1.add(jPasswordField2);
      jPasswordField2.setBounds(172, 89, 100, 20);
      jPasswordField2.addKeyListener(new KeyAdapter() {
        public void keyTyped(KeyEvent evt) {
          jPasswordField2KeyTyped(evt);
        }
      });

      jComboBoxLanguage.setEnabled(true);
      jComboBoxLanguage.setEditable(false);
      jComboBoxLanguage.setLightWeightPopupEnabled(true);
      jComboBoxLanguage.setPreferredSize(new java.awt.Dimension(45, 21));
      jComboBoxLanguage.setIgnoreRepaint(false);
      jDesktopPane1.add(jComboBoxLanguage);
      jComboBoxLanguage.setBounds(172, 116, 69, 21);
      jComboBoxLanguage.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          jComboBoxLanguageActionPerformed(evt);
        }
      });

      jTextFieldLastLogon.setEditable(false);
      jTextFieldLastLogon.setPreferredSize(new java.awt.Dimension(150, 20));
      jDesktopPane1.add(jTextFieldLastLogon);
      jTextFieldLastLogon.setBounds(172, 144, 150, 20);
      jTextFieldLastLogon.setEnabled(false);
      jTextFieldLastLogon.setDisabledTextColor(Common.color_textdisabled);

      jTextFieldLastPasswordChange.setEditable(false);
      jTextFieldLastPasswordChange.setPreferredSize(new java.awt.Dimension(150, 20));
      jDesktopPane1.add(jTextFieldLastPasswordChange);
      jTextFieldLastPasswordChange.setBounds(172, 171, 150, 20);
      jTextFieldLastPasswordChange.setEnabled(false);
      jTextFieldLastPasswordChange.setDisabledTextColor(Common.color_textdisabled);

      jLabel5.setText(lang.get("lbl_Language"));
      jDesktopPane1.add(jLabel5);
      jLabel5.setBounds(0, 117, 158, 20);
      jLabel5.setHorizontalAlignment(SwingConstants.TRAILING);

      jLabel6.setText(lang.get("lbl_User_Account_Last_Logon"));
      jDesktopPane1.add(jLabel6);
      jLabel6.setBounds(0, 144, 158, 20);
      jLabel6.setHorizontalAlignment(SwingConstants.TRAILING);

      jLabel7.setText(lang.get("lbl_User_Account_Last_Password_Change"));
      jDesktopPane1.add(jLabel7);
      jLabel7.setBounds(0, 171, 158, 20);
      jLabel7.setHorizontalAlignment(SwingConstants.TRAILING);

      jLabel8.setText(lang.get("lbl_User_Account_Locked"));
      jDesktopPane1.add(jLabel8);
      jLabel8.setBounds(0, 199, 158, 20);
      jLabel8.setHorizontalAlignment(SwingConstants.TRAILING);

      jLabel9.setText(lang.get("lbl_User_Account_Password_Expires"));
      jDesktopPane1.add(jLabel9);
      jLabel9.setBounds(0, 227, 158, 20);
      jLabel9.setHorizontalAlignment(SwingConstants.TRAILING);

      jLabel10.setText(lang.get("lbl_User_Account_Bad_Passwords"));
      jDesktopPane1.add(jLabel10);
      jLabel10.setFocusTraversalKeysEnabled(false);
      jLabel10.setBounds(0, 282, 158, 20);
      jLabel10.setHorizontalAlignment(SwingConstants.TRAILING);

      jTextFieldBadPasswords.setEditable(false);
      jTextFieldBadPasswords.setPreferredSize(new java.awt.Dimension(20, 20));
      jDesktopPane1.add(jTextFieldBadPasswords);
      jTextFieldBadPasswords.setBounds(172, 282, 20, 20);
      jTextFieldBadPasswords.setEnabled(false);
      jTextFieldBadPasswords.setDisabledTextColor(Common.color_textdisabled);

      jLabel11.setText(lang.get("lbl_User_Account_Password_Change_Allowed"));
      jDesktopPane1.add(jLabel11);
      jLabel11.setBounds(0, 255, 158, 20);
      jLabel11.setHorizontalAlignment(SwingConstants.TRAILING);

      jDesktopPane1.add(jCheckBoxAccountLocked);
      jCheckBoxAccountLocked.setBounds(170, 198, 21, 21);
      jCheckBoxAccountLocked.setBackground(new java.awt.Color(255, 255, 255));
      jCheckBoxAccountLocked.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          jCheckBoxAccountLockedActionPerformed(evt);
        }
      });

      jDesktopPane1.add(jCheckBoxPasswordExpires);
      jCheckBoxPasswordExpires.setBounds(169, 226, 21, 21);
      jCheckBoxPasswordExpires.setFont(Common.font_std);
      jCheckBoxPasswordExpires.setBackground(new java.awt.Color(255, 255, 255));
      jCheckBoxPasswordExpires.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          jCheckBoxPasswordExpiresActionPerformed(evt);
        }
      });

      jDesktopPane1.add(jCheckBoxPasswordChangeAllowed);
      jCheckBoxPasswordChangeAllowed.setBounds(169, 254, 21, 21);
      jCheckBoxPasswordChangeAllowed.setBackground(new java.awt.Color(255, 255, 255));
      jCheckBoxPasswordChangeAllowed.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          jCheckBoxPasswordChangeAllowedActionPerformed(evt);
        }
      });

      jButtonSave.setEnabled(false);
      jButtonSave.setText(lang.get("btn_Save"));
      jButtonSave.setMnemonic(lang.getMnemonicChar());
      jDesktopPane1.add(jButtonSave);
      jButtonSave.setBounds(39, 394, 112, 28);
      jButtonSave.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          jButtonUpdateActionPerformed(evt);
        }
      });

      jButtonCancel.setText(lang.get("btn_Close"));
      jButtonCancel.setMnemonic(lang.getMnemonicChar());
      jDesktopPane1.add(jButtonCancel);
      jButtonCancel.setBounds(277, 394, 112, 28);
      {
        jButtonHelp = new JButton4j(Common.icon_help);
        jDesktopPane1.add(jButtonHelp);
        jButtonHelp.setText(lang.get("btn_Help"));
        jButtonHelp.setBounds(158, 394, 112, 28);
        jButtonHelp.setMnemonic(lang.getMnemonicChar());
      }
View Full Code Here

    doc1.setDocumentFilter(new JFixedSizeFilter(JDBUser.field_user_id));

    fld_userName.setFont(Common.font_std);
    fld_userName.setText(System.getProperty("user.name"));
    fld_userName.setCaretPosition(fld_userName.getText().length());
    btn_close = new JButton4j("Close", Common.icon_cancel);
    btn_close.setBounds(142, 101, 104, 25);
    getContentPane().add(btn_close);
    btn_close.setMnemonic('C');
    btn_close.setToolTipText("Click to cancel logon.");
    btn_login = new JButton4j("Login", Common.icon_ok);
    btn_login.setBounds(19, 101, 104, 25);
    getContentPane().add(btn_login);
    btn_login.setMnemonic('L');
    btn_login.setToolTipText("Click to validate logon.");
    btn_login.addActionListener(buttonhandler);
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) {
          JDBPrinters printers = new JDBPrinters(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_PRINTER_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_PRINTER_ADD"));
        jButtonAdd.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            JDBPrinters prn = new JDBPrinters(Common.selectedHostID, Common.sessionID);

            printerID = JOptionPane.showInputDialog(Common.mainForm, "Enter new Printer ID");
            if (printerID != null)
            {
              if (printerID.equals("") == false)
              {
                printerID = printerID.toUpperCase();
                if (prn.create(printerID) == false)
                {
                  JUtility.errorBeep();
                  JOptionPane.showMessageDialog(Common.mainForm, prn.getErrorMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
                else
                {

                  populateList("");
                  JLaunchMenu.runDialog("FRM_ADMIN_PRINTER_EDIT", printerID);
                  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_PRINTER_DELETE"));
        jButtonDelete.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            int row = jTable1.getSelectedRow();
            if (row >= 0)
            {
              printerID = jTable1.getValueAt(row, 0).toString();

              int n = JOptionPane.showConfirmDialog(Common.mainForm, "Delete Printer ID " + printerID + " ?", "Confirm", JOptionPane.YES_NO_OPTION);
              if (n == 0)
              {
                JDBPrinters c = new JDBPrinters(Common.selectedHostID, Common.sessionID);
                c.setPrinterID(printerID);
                if (c.delete())
                {
                  JDBPrinterLineMembership plm = new JDBPrinterLineMembership(Common.selectedHostID,Common.sessionID);
                  plm.removePrinterfromAllLines(printerID);
                }
               
               
                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_PRINTERS"));
        jButtonPrint.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            JLaunchReport.runReport("RPT_PRINTERS",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

    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        jTextFieldDescription.requestFocus();
        jTextFieldDescription.setCaretPosition(jTextFieldDescription.getText().length());
       
        JButton4j btnSelect = new JButton4j("Background Color");
        btnSelect.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
             decis.setBackground(JColorChooser.showDialog(Common.mainForm, "Change Background",
                 decis.getBackground()));
             jTextFieldDescription.setBackground(decis.getBackground());
             jButtonUpdate.setEnabled(true);
          }
        });
        btnSelect.setBounds(46, 110, 133, 28);
        jDesktopPane1.add(btnSelect);
        {
          btnForground = new JButton4j("Forground Color");
          btnForground.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
               decis.setForeground(JColorChooser.showDialog(Common.mainForm, "Change Foreground",
                   decis.getForeground()));
               jTextFieldDescription.setForeground(decis.getForeground());
View Full Code Here

            jListHosts.setModel(jListHostsModel);
          }
        }
        {

          jButtonConnect = new JButton4j(Common.icon_connect);
          jButtonConnect.setBounds(45, 245, 110, 30);
          jDesktopPane1.add(jButtonConnect);
          jButtonConnect.setText("Connect");
          jButtonConnect.setMnemonic(java.awt.event.KeyEvent.VK_N);
          jButtonConnect.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              selectHost();
            }
          });
        }
        {
          jButtonClose = new JButton4j(Common.icon_close);
          jButtonClose.setBounds(161, 245, 110, 30);
          jDesktopPane1.add(jButtonClose);
          jButtonClose.setText("Close");
          jButtonClose.setMnemonic(java.awt.event.KeyEvent.VK_C);
          jButtonClose.addActionListener(new ActionListener() {
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.