Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enhydra.tool.common
Class SwingUtil  view SwingUtil download SwingUtil.java

java.lang.Object
  extended byorg.enhydra.tool.common.SwingUtil

public class SwingUtil
extends java.lang.Object

SwingUtil contains static utility methods for working with Swing classes.


Field Summary
(package private) static java.util.ResourceBundle res
           
 
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
 

Field Detail

res

static java.util.ResourceBundle res
Constructor Detail

SwingUtil

private SwingUtil()
Hidden default constructor

Method Detail

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.