ToolTips.
For example, any Swing component can use the JComponent
setToolTipText method to specify the text
for a standard tooltip. A component that wants to create a custom
ToolTip
display can override JComponent's createToolTip
method and use a subclass of this class.
See How to Use Tool Tips in The Java Tutorial for further documentation.
Warning
Swing is not thread safe. For more information see Swing's Threading Policy.
Warning
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans package.
Please see java..
JComponent#setToolTipText, JComponent#createToolTip
| Modifier and Type | Class and Description |
|---|---|
| protected class | JToolTip.
This class implements accessibility support for the
|
| Modifier and Type | Field and Description |
|---|---|
| pack-priv JComponent | |
| pack-priv String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | alwaysOnTop()
Overrides javax. Always returns true since tooltips, by definition, should always be on top of all other windows. |
| public AccessibleContext | Returns: an AccessibleJToolTip that serves as the AccessibleContext of this JToolTipOverrides java. Implements javax. Gets the AccessibleContext associated with this JToolTip. |
| public JComponent | Returns: the component that the tooltip describesReturns the component the tooltip applies to. |
| public String | Returns: theString that is displayedReturns the text that is shown when the tool tip is displayed. |
| public ToolTipUI | Returns: theToolTipUI object that renders this componentOverrides javax. Returns the L&F object that renders this component. |
| public String | Returns: the string "ToolTipUI"Overrides javax. Returns the name of the L&F class that renders this component. |
| protected String | Returns: a string representation of thisJToolTipOverrides javax. Returns a string representation of this |
| public void | setComponent(JComponent
the c)JComponent being describedSpecifies the component that the tooltip describes. |
| public void | setTipText(String
the tipText)String to displaySets the text to show when the tool tip is displayed. |
| public void | updateUI()
Overrides javax. Resets the UI property to a value from the current look and feel. |
| private void | writeObject(ObjectOutputStream s)
Hides javax. See |
| component | back to summary |
|---|---|
| pack-priv JComponent component Hides java. | |
| tipText | back to summary |
|---|---|
| pack-priv String tipText | |
| uiClassID | back to summary |
|---|---|
| private static final String uiClassID Hides javax.
| |
| JToolTip | back to summary |
|---|---|
| public JToolTip() Creates a tool tip. | |
| alwaysOnTop | back to summary |
|---|---|
| pack-priv boolean alwaysOnTop() Overrides javax. Always returns true since tooltips, by definition, should always be on top of all other windows. | |
| getAccessibleContext | back to summary |
|---|---|
| public AccessibleContext getAccessibleContext() Overrides java. Implements javax. Gets the AccessibleContext associated with this JToolTip. For tool tips, the AccessibleContext takes the form of an AccessibleJToolTip. A new AccessibleJToolTip instance is created if necessary.
| |
| getComponent | back to summary |
|---|---|
| public JComponent getComponent() Returns the component the tooltip applies to.
The returned value may be
| |
| getTipText | back to summary |
|---|---|
| public String getTipText() Returns the text that is shown when the tool tip is displayed.
The returned value may be
| |
| getUI | back to summary |
|---|---|
| public ToolTipUI getUI() Overrides javax. Returns the L&F object that renders this component.
| |
| getUIClassID | back to summary |
|---|---|
| public String getUIClassID() Overrides javax. Returns the name of the L&F class that renders this component.
| |
| paramString | back to summary |
|---|---|
| protected String paramString() Overrides javax. Returns a string representation of this
| |
| setComponent | back to summary |
|---|---|
| public void setComponent(JComponent c) Specifies the component that the tooltip describes.
The component This is a bound property.
| |
| setTipText | back to summary |
|---|---|
| public void setTipText(String tipText) Sets the text to show when the tool tip is displayed.
The string
| |
| updateUI | back to summary |
|---|---|
| public void updateUI() Overrides javax. Resets the UI property to a value from the current look and feel.
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream s) throws IOException Hides javax. See
| |
JToolTip class. It provides an implementation of the
Java Accessibility API appropriate to tool tip user-interface elements.Warning
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans package.
Please see java..
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: a localized String describing this object.Overrides javax. Get the accessible description of this object. |
| public AccessibleRole | Returns: an instance of AccessibleRole describing the role of the objectOverrides javax. Get the role of this object. |
| AccessibleJToolTip | back to summary |
|---|---|
| protected AccessibleJToolTip() Constructs an | |
| getAccessibleDescription | back to summary |
|---|---|
| public String getAccessibleDescription() Overrides javax. Get the accessible description of this object.
| |
| getAccessibleRole | back to summary |
|---|---|
| public AccessibleRole getAccessibleRole() Overrides javax. Get the role of this object.
| |