public void actionPerformed(ActionEvent e) {
    String cmd = e.getActionCommand();

    if (cmd.equals("ok")) System.out.println("do ok");
    else if (cmd.equals("cancel")) this.setVisible(false);
    else if (cmd.equals("help")) displayHelp();
  }
Exemple #2
0
 /** handle button events. */
 public void actionPerformed(ActionEvent e) {
   String cmd = e.getActionCommand();
   if (cmd.equals("run")) {
     if (animator.isAnimating()) stop();
     else start();
   } else if (cmd.equals("transparancy")) {
     if (drawable != null) drawable.setOpaque(!checkBox.isSelected());
   }
 }
 public void doAction(ActionEvent e) {
   String cmd = e.getActionCommand();
   // the new button creates a new set of texfields
   if (cmd.equals("new")) {
     Container container = getParent();
     if (container != null) container.setVisible(false);
     displayNewTxf("", "");
     if (container != null) container.setVisible(true);
   }
 }
Exemple #4
0
 /**
  * Checks the passwords of the user
  *
  * @param e The ActionEvent for this action.
  */
 public void actionPerformed(ActionEvent e) {
   String cmd = e.getActionCommand();
   // checks if the user has a unix password, if it matches, then logs the user
   // in the interface, otherwise checks for the vnmrj password,
   // if neither password matches, then the user is not logged in the interface
   if (cmd.equalsIgnoreCase("enter")) enterLogin();
   else if (cmd.equalsIgnoreCase("cancel")) {
     m_passwordField.setText("");
     m_lblLogin.setForeground(getBackground());
     // setVisible(false);
   } else if (cmd.equalsIgnoreCase("help")) displayHelp();
 }
 /**
  * ************************************************
  *
  * <pre>
  * Summary: Listener for all buttons.
  *
  *
  * </pre>
  *
  * *************************************************
  */
 public void actionPerformed(ActionEvent e) {
   String cmd = e.getActionCommand();
   // Cancel
   if (cmd.equals("cancel")) {
     result = null;
     setVisible(false);
   }
   // Help
   else if (cmd.equals("help")) {
     // Do not call setVisible(false);  That will cause
     // the Block to release and the code which create
     // this object will try to use userText.  This way
     // the panel stays up and the Block stays in effect.
     displayHelp();
   } else if (cmd.equals("add")) {
     result = "add";
     setVisible(false);
   } else if (cmd.equals("remove")) {
     result = "remove";
     setVisible(false);
   }
 }
Exemple #6
0
 public void actionPerformed(ActionEvent e) {
   String cmd = e.getActionCommand();
   if (cmd.equals("close")) {
     if (m_nType == CONFIG) saveData();
     else if (m_nType == DEFAULT && m_pnlAccPolicy != null) m_pnlAccPolicy.saveData();
     setVisible(false);
     dispose();
   } else if (cmd.equals("validate")) {
     if (timer != null) timer.cancel();
     if (m_nType == CHECKSUM && m_pnlChecksum != null) m_pnlChecksum.checksumValidation();
     else doSysValidation();
     validateButton.setBackground(closeButton.getBackground());
   } else if (cmd.equals("checksum")) {
     String strValue = m_pnlChecksum.getChecksum();
     m_pnlChecksum.setData(strValue);
   } else if (cmd.equals("checksumdir")) {
     m_pnlChecksum.setData("");
   } else if (cmd.equals("cancel")) {
     // build(m_bAccPolicy);
     setVisible(false);
     dispose();
   } else if (cmd.equals("help")) displayHelp();
 }
Exemple #7
0
 /**
  * action performed
  *
  * @param evt event
  */
 public void actionPerformed(ActionEvent evt) {
   popButton.popNotify(evt.getActionCommand());
 } // actionPerformed()