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

Quick Search    Search Deep

com.virtuosotechnologies.lib.swing
Class SwingUtils  view SwingUtils download SwingUtils.java

java.lang.Object
  extended bycom.virtuosotechnologies.lib.swing.SwingUtils

public final class SwingUtils
extends java.lang.Object

Various utilities for swing.


Field Summary
private static int shortcutMask_
           
 
Constructor Summary
private SwingUtils()
          Prevent instantiation
 
Method Summary
static javax.swing.KeyStroke buildAcceleratorKeyStroke(java.lang.String spec)
          Build an accelerator keystroke.
static javax.swing.JDialog createJDialog(javax.swing.JComponent parent, java.lang.String title, boolean modal)
          Create a new JDialog.
static int getIndexOfComponent(java.awt.Container container, java.awt.Component component)
          Get the index of the given component in the given container.
static void invokeOnSwingThread(java.lang.Runnable job)
          Invoke a job on the awt/swing event thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shortcutMask_

private static int shortcutMask_
Constructor Detail

SwingUtils

private SwingUtils()
Prevent instantiation

Method Detail

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).