Package org.apache.log4j.chainsaw.helper
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.- Author:
- Paul Smith <psmith@apache.org>
-
-
Constructor Summary
Constructors Constructor Description SwingHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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()
static List<JButton>
orderOKCancelButtons(JButton okButton, JButton cancelButton)
static File
promptForFile(Container parent, String defaultPath, String title, boolean loadDialog)
-
-
-
Method Detail
-
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)
-
-