@PublicAPI public class SwingUtil extends java.lang.Object implements java.io.Serializable
Constructor and Description |
---|
SwingUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addHyperlinkListener(javax.swing.JEditorPane editorPane)
Adds HTML link handling to an editor pane.
|
static javax.swing.JMenu |
createMenu(java.util.ResourceBundle rc,
java.lang.String key)
Utility method to create a menu with a label specified as a resource.
|
static javax.swing.JMenu |
createMenu(java.util.ResourceBundle rc,
java.lang.String key,
boolean mnemo)
Creates a menu with a label specified as a resource.
|
static javax.swing.JMenuItem |
createMenuItem(java.util.ResourceBundle rc,
java.lang.String key)
Creates a menu with a label specified as a resource.
|
static javax.swing.JMenuItem |
createMenuItem(java.util.ResourceBundle rc,
java.lang.String key,
boolean mnemo)
Creates a menu with a label specified as a resource.
|
static javax.swing.JMenuItem |
createMenuItem(java.util.ResourceBundle rc,
java.lang.String key,
java.lang.Class<?> what,
boolean mnemo)
Creates a menu item with a label specified as a resource.
|
static javax.swing.JEditorPane |
createMessagePane(java.lang.String text)
Creates a message pane with HTML text content.
|
static javax.swing.JPanel |
createSubPanel(java.lang.String title)
Creates a sub-panel with a title.
|
static java.awt.GridBagConstraints |
createTopLeftConstraints()
Creates GridBagConstraints for the top left component.
|
static void |
decorateSubPanel(javax.swing.JPanel panel,
java.lang.String title)
Creates border and title for a panel.
|
static javax.swing.KeyStroke |
getCommandKeyStroke(int key)
Gets the command keystroke preferred on the current platform.
|
static void |
initAction(javax.swing.Action action,
java.util.ResourceBundle rc,
java.lang.String key,
javax.swing.KeyStroke accel)
Initializes an action from information in a resource.
|
static void |
initButton(javax.swing.AbstractButton b,
java.util.ResourceBundle rc,
java.lang.String key)
Utility method to initialize a button from information in a resource.
|
static void |
initButton(javax.swing.AbstractButton b,
java.util.ResourceBundle rc,
java.lang.String key,
boolean mnemo)
Utility method to initialize a button from information in a resource.
|
static void |
initCtrlShortcutForMac(javax.swing.JMenuItem mi)
Deprecated.
does nothing.
|
static void |
initInApplet()
Deprecated.
does nothing.
|
static <T> T |
invokeAndWait(java.util.concurrent.Callable<T> callable)
Calls SwingUtilities.invokeLater() for a Callable by wrapping it into a FutureTask object,
blocks until it is finished and returns the result (calling FutureTask.get()).
|
static <T> java.util.concurrent.FutureTask<T> |
invokeLater(java.util.concurrent.Callable<T> callable)
Calls SwingUtilities.invokeLater() for a Callable by wrapping it into a FutureTask object.
|
static void |
setDefaultFont(javax.swing.JEditorPane editorPane)
Sets the SWING default font in the JEditorPane.
|
@Deprecated public static void initInApplet()
public static javax.swing.KeyStroke getCommandKeyStroke(int key)
key
- the keypublic static javax.swing.JMenuItem createMenuItem(java.util.ResourceBundle rc, java.lang.String key, java.lang.Class<?> what, boolean mnemo)
rc
- the resourceskey
- name of the label resourcewhat
- menu item classmnemo
- use mnemonic or notpublic static javax.swing.JMenuItem createMenuItem(java.util.ResourceBundle rc, java.lang.String key, boolean mnemo)
rc
- the resourceskey
- name of the label resourcemnemo
- set the mnemonic or notpublic static javax.swing.JMenuItem createMenuItem(java.util.ResourceBundle rc, java.lang.String key)
rc
- the resourceskey
- name of the label resourcepublic static javax.swing.JMenu createMenu(java.util.ResourceBundle rc, java.lang.String key)
rc
- the resourceskey
- name of the label resourcepublic static javax.swing.JMenu createMenu(java.util.ResourceBundle rc, java.lang.String key, boolean mnemo)
rc
- the resourceskey
- name of the label resourcemnemo
- set the mnemonic or notpublic static void initButton(javax.swing.AbstractButton b, java.util.ResourceBundle rc, java.lang.String key)
b
- the buttonrc
- the resourceskey
- name of the resourcepublic static void initButton(javax.swing.AbstractButton b, java.util.ResourceBundle rc, java.lang.String key, boolean mnemo)
b
- the buttonrc
- the resourceskey
- name of the resourcemnemo
- set the mnemonic or notpublic static void initAction(javax.swing.Action action, java.util.ResourceBundle rc, java.lang.String key, javax.swing.KeyStroke accel)
action
- the actionrc
- the resourceskey
- name of the resourceaccel
- the accelerator or null@Deprecated public static void initCtrlShortcutForMac(javax.swing.JMenuItem mi)
public static void decorateSubPanel(javax.swing.JPanel panel, java.lang.String title)
title
- the panel titlepublic static javax.swing.JPanel createSubPanel(java.lang.String title)
title
- the panel titledecorateSubPanel(JPanel, String)
public static java.awt.GridBagConstraints createTopLeftConstraints()
public static javax.swing.JEditorPane createMessagePane(java.lang.String text)
text
- the content, may contain HTML linkspublic static void setDefaultFont(javax.swing.JEditorPane editorPane)
editorPane
- the JEditorPanepublic static void addHyperlinkListener(javax.swing.JEditorPane editorPane)
editorPane
- the JEditorPanepublic static <T> java.util.concurrent.FutureTask<T> invokeLater(java.util.concurrent.Callable<T> callable)
callable
- the Callable object to be invoked on the event dispatch threadpublic static <T> T invokeAndWait(java.util.concurrent.Callable<T> callable) throws java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
callable
- the Callable object to be invoked on the event dispatch threadjava.lang.InterruptedException
java.lang.reflect.InvocationTargetException