Package org.apache.log4j.chainsaw.helper
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 void
centerOnScreen
(Component component) Centers the Component on screen.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 mapstatic void
invokeOnEDT
(Runnable runnable) static boolean
isMacOSX()
orderOKCancelButtons
(JButton okButton, JButton cancelButton) static File
promptForFile
(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
-