java.lang.Object
org.enhydra.tool.common.SwingUtil
- public class SwingUtil
- extends java.lang.Object
SwingUtil contains static utility methods for working with Swing
classes.
|
Constructor Summary |
private |
SwingUtil()
Hidden default constructor |
|
Method Summary |
static java.awt.Point |
getCenteringPoint(java.awt.Dimension size)
Get the point on point on the screen at which to open a dialog
or window for it to appear centered. |
static java.io.File |
getDirectoryChoice(java.awt.Component owner,
java.io.File defaultDir,
java.lang.String title)
Open a JFileChooser dialog for selecting a directory and return the
selected directory. |
static java.io.File |
getDirectoryChoice(java.awt.Component owner,
java.lang.String defaultDir,
java.lang.String title)
Open a JFileChooser dialog for selecting a directory and return the
selected directory. |
static java.io.File |
getFileChoice(java.awt.Component owner,
java.io.File defaultSelection,
ExtensionFilter filter,
java.lang.String title)
Get a file selection using the FileChooser dialog. |
static java.io.File |
getFileChoice(java.awt.Component owner,
java.lang.String defaultSelection,
ExtensionFilter filter,
java.lang.String title)
Get a file selection using the FileChooser dialog. |
static void |
setLookAndFeelToSystem()
Sets the look and feel to the native operating system look and feel. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
res
static java.util.ResourceBundle res
SwingUtil
private SwingUtil()
- Hidden default constructor
getDirectoryChoice
public static java.io.File getDirectoryChoice(java.awt.Component owner,
java.lang.String defaultDir,
java.lang.String title)
- Open a JFileChooser dialog for selecting a directory and return the
selected directory.
getDirectoryChoice
public static java.io.File getDirectoryChoice(java.awt.Component owner,
java.io.File defaultDir,
java.lang.String title)
- Open a JFileChooser dialog for selecting a directory and return the
selected directory.
getFileChoice
public static java.io.File getFileChoice(java.awt.Component owner,
java.lang.String defaultSelection,
ExtensionFilter filter,
java.lang.String title)
- Get a file selection using the FileChooser dialog.
getFileChoice
public static java.io.File getFileChoice(java.awt.Component owner,
java.io.File defaultSelection,
ExtensionFilter filter,
java.lang.String title)
- Get a file selection using the FileChooser dialog.
getCenteringPoint
public static java.awt.Point getCenteringPoint(java.awt.Dimension size)
- Get the point on point on the screen at which to open a dialog
or window for it to appear centered. This point is the top right hand
corner of the container you want to position.
setLookAndFeelToSystem
public static void setLookAndFeelToSystem()
- Sets the look and feel to the native operating system look and feel.
This method ignores any exceptions that may occur when you set
the look and feel.