Class SwingHelper

java.lang.Object
org.apache.log4j.chainsaw.helper.SwingHelper

public final class SwingHelper extends Object
A collection of standard utility methods for use within Swing.
  • Constructor Details

    • SwingHelper

      public SwingHelper()
  • Method Details

    • centerOnScreen

      public static void centerOnScreen(Component component)
      Centers the Component on screen.
      Parameters:
      component -
    • configureCancelForDialog

      public static void configureCancelForDialog(JDialog dialog, JButton cancelButton)
      This method configures a standard Cancel action, bound to the ESC key, to dispose of the dialog, and sets the buttons action to be this action, and adds the action to the dialog's rootPane action map
      Parameters:
      dialog -
      cancelButton -
    • invokeOnEDT

      public static void invokeOnEDT(Runnable runnable)
    • isMacOSX

      public static boolean isMacOSX()
    • orderOKCancelButtons

      public static List<JButton> orderOKCancelButtons(JButton okButton, JButton cancelButton)
    • promptForFile

      public static File promptForFile(Container parent, String defaultPath, String title, boolean loadDialog)