javax.swing

Class JToolTip

public class JToolTip extends JComponent implements Accessible

This class is used to display ToolTips. ToolTips are small floating windows that display text when the mouse comes to rest over a Component. ToolTips are set for JComponents using JComponent.setToolTipText(String).
Nested Class Summary
protected classJToolTip.AccessibleJToolTip
Provides the accessibility features for the JToolTip component.
Constructor Summary
JToolTip()
Creates a new JToolTip instance.
Method Summary
AccessibleContextgetAccessibleContext()
Returns the object that provides accessibility features for this JToolTip component.
JComponentgetComponent()
Returns the component that the tool tip is associated with.
StringgetTipText()
Returns the text displayed by the tool tip.
ToolTipUIgetUI()
Returns the current UI delegate for this component.
StringgetUIClassID()
Returns the string suffix used to identify the UI class, in this case "ToolTipUI".
protected StringparamString()
Returns a string describing the attributes for the JToolTip component, for use in debugging.
voidsetComponent(JComponent c)
Sets the component that the tool tip is associated with and sends a {@link PropertyChangeEvent} (with the property name 'component') to all registered listeners.
voidsetTipText(String tipText)
Sets the text to be displayed by the tool tip and sends a {@link PropertyChangeEvent} (with the property name 'tiptext') to all registered listeners.
voidupdateUI()
This method resets the UI used to the Look and Feel default.

Constructor Detail

JToolTip

public JToolTip()
Creates a new JToolTip instance.

Method Detail

getAccessibleContext

public AccessibleContext getAccessibleContext()
Returns the object that provides accessibility features for this JToolTip component.

Returns: The accessible context (an instance of {@link AccessibleJToolTip}).

getComponent

public JComponent getComponent()
Returns the component that the tool tip is associated with.

Returns: The component (possibly null).

See Also: setComponent

getTipText

public String getTipText()
Returns the text displayed by the tool tip.

Returns: The text (possibly null).

See Also: setTipText

getUI

public ToolTipUI getUI()
Returns the current UI delegate for this component.

Returns: The UI delegate.

getUIClassID

public String getUIClassID()
Returns the string suffix used to identify the UI class, in this case "ToolTipUI".

Returns: "ToolTipUI".

paramString

protected String paramString()
Returns a string describing the attributes for the JToolTip component, for use in debugging. The return value is guaranteed to be non-null, but the format of the string may vary between implementations.

Returns: A string describing the attributes of the JToolTip.

setComponent

public void setComponent(JComponent c)
Sets the component that the tool tip is associated with and sends a {@link PropertyChangeEvent} (with the property name 'component') to all registered listeners.

Parameters: c the component (null permitted).

See Also: getComponent

setTipText

public void setTipText(String tipText)
Sets the text to be displayed by the tool tip and sends a {@link PropertyChangeEvent} (with the property name 'tiptext') to all registered listeners.

Parameters: tipText the text (null permitted).

See Also: getTipText

updateUI

public void updateUI()
This method resets the UI used to the Look and Feel default.