public class SwingUtils extends Object
| Constructor and Description |
|---|
SwingUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
configureCloseDialogOnEscape(JDialog dialog)
Configures a
JDialog to be closed when ESC key is pressed. |
static List<Component> |
getAllComponents(Container container)
Returns all the components (and their children) associated to the given container.
|
static File |
getSelectedFileWithExtension(JFileChooser c)
Thanks to user Boann at StackOverflow for his getSelectedFileWithExtension
|
static void |
setEnabled(JComponent component,
boolean enabled)
Enables/disables a
JComponent and all its associated children. |
public static void configureCloseDialogOnEscape(JDialog dialog)
JDialog to be closed when ESC key is pressed.dialog - JDialogpublic static List<Component> getAllComponents(Container container)
container - ContainerComponent listpublic static File getSelectedFileWithExtension(JFileChooser c)
c - JFileChooser where the file is selected.public static void setEnabled(JComponent component, boolean enabled)
JComponent and all its associated children.component - JComponentenabled - true if this component should be enabled, false otherwiseCopyright © 2018. All rights reserved.