public final class WordWrappingToolTipUI
extends javax.swing.plaf.basic.BasicToolTipUI
The wrapping behavior is disabled for any tooltip which has HTML text. It
may also be disabled for a specific tooltip instance by calling
disableWordWrapping(JToolTip)
. You can disable wrapping for
the tooltips for a given component by overriding the JComponent.createToolTip()
method like so:
JButton b = new JButton() { public JToolTip createToolTip() { JToolTip tip = new JToolTip(); WordWrappingToolTipUI.disableWordWrapping( tip ); return tip; } };
Constructor and Description |
---|
WordWrappingToolTipUI() |
Modifier and Type | Method and Description |
---|---|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c) |
static void |
disableWordWrapping(javax.swing.JToolTip tip)
Disables word wrapping for the specified JToolTip instance.
|
java.awt.Dimension |
getPreferredSize(javax.swing.JComponent c) |
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c) |
getMaximumSize, getMinimumSize, installDefaults, installListeners, installUI, uninstallDefaults, uninstallListeners, uninstallUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
public static void disableWordWrapping(javax.swing.JToolTip tip)
tip
- a tool tip to disable wrapping for.java.lang.NullPointerException
- if tip is null.public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
getPreferredSize
in class javax.swing.plaf.basic.BasicToolTipUI
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
paint
in class javax.swing.plaf.basic.BasicToolTipUI