Class OkCancelButtonPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class OkCancelButtonPanel extends JPanel
This class is a JPanel with a "Cancel" and a "OK" button.
Author:
Carsten Schulze, FH Osnabrück - University of Applied Sciences Osnabrück, Project: PIROL (2005), Subproject: Daten- und Wissensmanagement [sstein] - 22.Feb.2009 - modified to work in OpenJUMP
See Also:
  • Field Details

    • OK_BUTTON_ACTION_COMMAND

      public static final String OK_BUTTON_ACTION_COMMAND
      The constant ActionCommand String for the ok-button
    • CANCEL_BUTTON_ACTION_COMMAND

      public static final String CANCEL_BUTTON_ACTION_COMMAND
      The constant ActionCommand String for the cancel-button
  • Constructor Details

    • OkCancelButtonPanel

      public OkCancelButtonPanel()
      This is the default constructor
  • Method Details

    • addActionListener

      public void addActionListener(ActionListener listener)
      Adds the given ActionListener to both buttons.
      Parameters:
      listener - the listener
    • getCancelButton

      public JButton getCancelButton()
      This method initializes cancelButton
      Returns:
      javax.swing.JButton
    • getOkButton

      public JButton getOkButton()
      This method initializes okButton
      Returns:
      javax.swing.JButton
    • setOkButtonEnabled

      public void setOkButtonEnabled(boolean enable)
      Enables/Disables the ok button. May be useful, if the user had to put in values that may not be correct. You can disable the ok button in this case.
      Parameters:
      enable - enables the ok button if true, else disables it
    • requestFocus

      public void requestFocus()
      Overrides:
      requestFocus in class JComponent