Package org.apache.log4j.chainsaw.helper
Class SwingHelper
- java.lang.Object
-
- org.apache.log4j.chainsaw.helper.SwingHelper
-
public final class SwingHelper extends java.lang.ObjectA collection of standard utility methods for use within Swing.
-
-
Constructor Summary
Constructors Constructor Description SwingHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcenterOnScreen(java.awt.Component component)Centers the Component on screen.static voidconfigureCancelForDialog(javax.swing.JDialog dialog, javax.swing.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(java.lang.Runnable runnable)static booleanisMacOSX()static java.util.List<javax.swing.JButton>orderOKCancelButtons(javax.swing.JButton okButton, javax.swing.JButton cancelButton)static java.io.FilepromptForFile(java.awt.Container parent, java.lang.String defaultPath, java.lang.String title, boolean loadDialog)
-
-
-
Method Detail
-
centerOnScreen
public static void centerOnScreen(java.awt.Component component)
Centers the Component on screen.- Parameters:
component-
-
configureCancelForDialog
public static void configureCancelForDialog(javax.swing.JDialog dialog, javax.swing.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(java.lang.Runnable runnable)
-
isMacOSX
public static boolean isMacOSX()
-
orderOKCancelButtons
public static java.util.List<javax.swing.JButton> orderOKCancelButtons(javax.swing.JButton okButton, javax.swing.JButton cancelButton)
-
promptForFile
public static java.io.File promptForFile(java.awt.Container parent, java.lang.String defaultPath, java.lang.String title, boolean loadDialog)
-
-