java.lang.Object
com.virtuosotechnologies.lib.swing.SwingUtils
- public final class SwingUtils
- extends java.lang.Object
Various utilities for swing.
|
Constructor Summary |
private |
SwingUtils()
Prevent instantiation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
shortcutMask_
private static int shortcutMask_
SwingUtils
private SwingUtils()
- Prevent instantiation
invokeOnSwingThread
public static void invokeOnSwingThread(java.lang.Runnable job)
- Invoke a job on the awt/swing event thread. This is different from
SwingUtilities.invokeLater() in that if the current thread is the
awt/swing thread, it runs the job immediately rather than queuing
another event.
getIndexOfComponent
public static int getIndexOfComponent(java.awt.Container container,
java.awt.Component component)
- Get the index of the given component in the given container.
Returns -1 if the component is not in the container.
createJDialog
public static javax.swing.JDialog createJDialog(javax.swing.JComponent parent,
java.lang.String title,
boolean modal)
- Create a new JDialog. Simulates a constructor Swing should have provided.
buildAcceleratorKeyStroke
public static javax.swing.KeyStroke buildAcceleratorKeyStroke(java.lang.String spec)
- Build an accelerator keystroke. The input string should be of the format:
"[shift] ", similar to the KeyStroke parse format except that the
only allowed modifier is "shift". This method will automatically add the platform-
dependent modifier (ctrl for Windows/Linux, meta for Mac OS X).