public class Utility extends Object
| Constructor and Description |
|---|
Utility() |
| Modifier and Type | Method and Description |
|---|---|
static Component |
addLeftJustifiedComponent(Component component) |
static Component |
addRightJustifiedComponent(Component component) |
static JButton |
createButton(Class resourceClass,
String imageResourceName,
String tooltip,
Action action)
This creates a button with the specified action, image, and tooltip text.
|
static JDialog |
createDialog(Window parent,
String title,
boolean isModal)
This creates a dialog.
|
static JMenuItem |
createMenuItem(Class resourceClass,
String name,
String imageResourceName,
Action action) |
static JToggleButton |
createToggleButton(Class resourceClass,
String imageResourceName,
String tooltip,
Action action) |
static ImageIcon |
getImageIcon(Class resourceClass,
String imageResourceName) |
static boolean |
isCTRLDown(int eventModifiersEx)
this determines if the CTRL key is down based on the modifiers from an event.
|
static void |
scrollToText(JTextComponent textComponent,
int startingIndex,
int endingIndex)
Scrolls the specified text component so the text between the starting and ending index are visible.
|
static void |
setTabComponent15Compatible(JTabbedPane tabbedPane,
int index,
Component component)
This uses reflection to set the tab component if we're running under 1.6.
|
public static JDialog createDialog(Window parent, String title, boolean isModal)
parent - the parent windowisModal - true if its modal, false if not.public static void setTabComponent15Compatible(JTabbedPane tabbedPane, int index, Component component)
public static JButton createButton(Class resourceClass, String imageResourceName, String tooltip, Action action)
resourceClass - the calling class. Useful when multiple classloaders are used.imageResourceName - the image resourcetooltip - the tooltip to displayaction - the action to performpublic static JToggleButton createToggleButton(Class resourceClass, String imageResourceName, String tooltip, Action action)
public static JMenuItem createMenuItem(Class resourceClass, String name, String imageResourceName, Action action)
public static boolean isCTRLDown(int eventModifiersEx)
public static void scrollToText(JTextComponent textComponent, int startingIndex, int endingIndex)
Copyright © 2013. All rights reserved