Class SwingHelper
java.lang.Object
org.apache.log4j.chainsaw.helper.SwingHelper
A collection of standard utility methods for use within Swing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcenterOnScreen(Component component) Centers the Component on screen.static voidconfigureCancelForDialog(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 mapstatic voidinvokeOnEDT(Runnable runnable) static booleanisMacOSX()orderOKCancelButtons(JButton okButton, JButton cancelButton) static FilepromptForFile(Container parent, String defaultPath, String title, boolean loadDialog)
-
Constructor Details
-
SwingHelper
public SwingHelper()
-
-
Method Details
-
centerOnScreen
Centers the Component on screen.- Parameters:
component-
-
configureCancelForDialog
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
-
isMacOSX
public static boolean isMacOSX() -
orderOKCancelButtons
-
promptForFile
-