public class SwingUtil extends Object
| Constructor and Description |
|---|
SwingUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addAction(JComponent component,
KeyStroke keyStroke,
String actionKey,
Object object,
String methodName,
Object... parameters) |
static JComponent |
addField(Container panel,
String fieldName,
Object fieldValue) |
static JComponent |
addField(Container panel,
String fieldName,
String label,
Object fieldValue) |
static JLabel |
addLabel(Container container,
String text) |
static void |
addLabelledReadOnlyTextField(JPanel container,
String fieldName,
Object value) |
static void |
addLabelledReadOnlyTextField(JPanel container,
String fieldName,
Object value,
int length) |
static JComponent |
addObjectField(Container container,
Object object,
String fieldName) |
static JComponent |
addObjectField(Container panel,
Object object,
String fieldName,
String label) |
static void |
addReadOnlyTextField(JPanel container,
String fieldName,
Object value,
int length) |
static Rectangle |
applyInsets(Rectangle bounds,
Insets insets) |
static void |
autoAdjustPosition(Window window) |
static ComboBox |
createComboBox(CodeTable codeTable,
boolean required,
int maxLength) |
static ComboBox |
createComboBox(String fieldName,
CodeTable codeTable,
boolean required,
int maxLength) |
static DataFlavor |
createDataFlavor(String mimeType) |
static DateField |
createDateField(String fieldName) |
static <T extends JComponent> |
createField(Class<?> fieldClass,
String fieldName,
Object fieldValue) |
static <T extends Field> |
createField(RecordDefinition recordDefinition,
String fieldName,
boolean editable) |
static JFileChooser |
createFileChooser(Class<?> preferencesClass,
String preferenceName) |
static JFileChooser |
createFileChooser(String title,
String preferencesGroup,
String preferenceName) |
static JLabel |
createLabel(String text) |
static TextArea |
createTextArea(int rows,
int columns) |
static TextArea |
createTextArea(String fieldName,
int rows,
int columns) |
static TextField |
createTextField(int columns) |
static TextField |
createTextField(String fieldName,
int columns) |
static void |
dndCopy(Component component) |
static void |
dndCut(Component component) |
static void |
dndPaste(Component component) |
static Window |
getActiveWindow() |
static Component |
getInvoker(JMenuItem menuItem) |
static Rectangle |
getScreenBounds() |
static Rectangle |
getScreenBounds(Component component) |
static Rectangle |
getScreenBounds(int x,
int y) |
static Rectangle |
getScreenBounds(Point point)
Get the screen rectangle in which the mouse is in.
|
static int |
getTabIndex(JTabbedPane tabs,
String title) |
static JTextComponent |
getTextComponent(Component component) |
static <V> V |
getValue(JComponent component) |
static Window |
getWindowAncestor(Component component) |
static int |
getX(Component component) |
static int |
getY(Component component) |
static boolean |
isAltDown(InputEvent event) |
static boolean |
isControlDown(InputEvent event) |
static boolean |
isControlOrMetaDown(InputEvent event) |
static boolean |
isEventDispatchThread() |
static boolean |
isLeftButtonAndAltDown(MouseEvent event)
Check to see if the event is for the left mouse button and the Alt key is pressed.
|
static boolean |
isLeftButtonAndNoModifiers(MouseEvent event) |
static boolean |
isLeftButtonOnly(MouseEvent event) |
static boolean |
isMetaDown(InputEvent event) |
static boolean |
isMiddleDown(InputEvent event) |
static boolean |
isModifierKeyDown(InputEvent event) |
static boolean |
isRightDown(InputEvent event) |
static boolean |
isScrollReversed() |
static boolean |
isShiftDown(InputEvent event) |
static void |
saveFileChooserDirectory(Class<?> preferencesClass,
String preferenceName,
JFileChooser fileChooser) |
static void |
setDescendantsEnabled(Component component,
boolean enabled) |
static void |
setFieldValue(JComponent field,
Object value) |
static void |
setLocationCentre(Rectangle bounds,
Window window) |
static void |
setLocationCentre(Window window) |
static void |
setMaximumWidth(JComponent component,
int width) |
static void |
setSize(Window window,
int minusX,
int minusY) |
static void |
setSizeAndMaximize(JFrame frame,
int minusX,
int minusY) |
static void |
setSplashTitle(String title) |
static void |
setTitledBorder(JComponent component,
String title) |
static void |
setVisible(Component component,
boolean visible) |
static void |
showErrorDialog(Window window,
String title,
String message,
Throwable e) |
public static void addAction(JComponent component, KeyStroke keyStroke, String actionKey, Object object, String methodName, Object... parameters)
public static JComponent addField(Container panel, String fieldName, Object fieldValue)
public static JComponent addField(Container panel, String fieldName, String label, Object fieldValue)
public static void addLabelledReadOnlyTextField(JPanel container, String fieldName, Object value)
public static void addLabelledReadOnlyTextField(JPanel container, String fieldName, Object value, int length)
public static JComponent addObjectField(Container container, Object object, String fieldName)
public static JComponent addObjectField(Container panel, Object object, String fieldName, String label)
public static void addReadOnlyTextField(JPanel container, String fieldName, Object value, int length)
public static void autoAdjustPosition(Window window)
public static ComboBox createComboBox(CodeTable codeTable, boolean required, int maxLength)
public static ComboBox createComboBox(String fieldName, CodeTable codeTable, boolean required, int maxLength)
public static DataFlavor createDataFlavor(String mimeType)
public static <T extends JComponent> T createField(Class<?> fieldClass, String fieldName, Object fieldValue)
public static <T extends Field> T createField(RecordDefinition recordDefinition, String fieldName, boolean editable)
public static JFileChooser createFileChooser(Class<?> preferencesClass, String preferenceName)
public static JFileChooser createFileChooser(String title, String preferencesGroup, String preferenceName)
public static TextArea createTextArea(int rows, int columns)
public static TextField createTextField(int columns)
public static void dndCopy(Component component)
public static void dndCut(Component component)
public static void dndPaste(Component component)
public static Window getActiveWindow()
public static Rectangle getScreenBounds()
public static Rectangle getScreenBounds(int x, int y)
public static Rectangle getScreenBounds(Point point)
point - public static int getTabIndex(JTabbedPane tabs, String title)
public static JTextComponent getTextComponent(Component component)
public static <V> V getValue(JComponent component)
public static int getX(Component component)
public static int getY(Component component)
public static boolean isAltDown(InputEvent event)
public static boolean isControlDown(InputEvent event)
public static boolean isControlOrMetaDown(InputEvent event)
public static boolean isEventDispatchThread()
public static boolean isLeftButtonAndAltDown(MouseEvent event)
event - public static boolean isLeftButtonAndNoModifiers(MouseEvent event)
public static boolean isLeftButtonOnly(MouseEvent event)
public static boolean isMetaDown(InputEvent event)
public static boolean isMiddleDown(InputEvent event)
public static boolean isModifierKeyDown(InputEvent event)
public static boolean isRightDown(InputEvent event)
public static boolean isScrollReversed()
public static boolean isShiftDown(InputEvent event)
public static void saveFileChooserDirectory(Class<?> preferencesClass, String preferenceName, JFileChooser fileChooser)
public static void setDescendantsEnabled(Component component, boolean enabled)
public static void setFieldValue(JComponent field, Object value)
public static void setLocationCentre(Window window)
public static void setMaximumWidth(JComponent component, int width)
public static void setSize(Window window, int minusX, int minusY)
public static void setSizeAndMaximize(JFrame frame, int minusX, int minusY)
public static void setSplashTitle(String title)
public static void setTitledBorder(JComponent component, String title)
public static void setVisible(Component component, boolean visible)
Copyright © 2015 Revolution Systems Inc.. All rights reserved.