- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ToolTipUI
-
- javax.swing.plaf.basic.BasicToolTipUI
-
- Direct Known Subclasses:
- MetalToolTipUI, SynthToolTipUI
public class BasicToolTipUI extends ToolTipUI
Standard tool tip L&F.
-
-
Constructor Summary
Constructors Constructor and Description BasicToolTipUI()
-
Method Summary
Methods Modifier and Type Method and Description static ComponentUIcreateUI(JComponent c)DimensiongetMaximumSize(JComponent c)Returns the specified component's maximum size appropriate for the look and feel.DimensiongetMinimumSize(JComponent c)Returns the specified component's minimum size appropriate for the look and feel.DimensiongetPreferredSize(JComponent c)Returns the specified component's preferred size appropriate for the look and feel.protected voidinstallDefaults(JComponent c)protected voidinstallListeners(JComponent c)voidinstallUI(JComponent c)Configures the specified component appropriately for the look and feel.voidpaint(Graphics g, JComponent c)Paints the specified component appropriately for the look and feel.protected voiduninstallDefaults(JComponent c)protected voiduninstallListeners(JComponent c)voiduninstallUI(JComponent c)Reverses configuration which was done on the specified component duringinstallUI.-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, update
-
-
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installUI
public void installUI(JComponent c)
Description copied from class:ComponentUIConfigures the specified component appropriately for the look and feel. This method is invoked when theComponentUIinstance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:- Install default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
- Install a
LayoutManageron the component if necessary. - Create/add any required sub-components to the component.
- Create/install event listeners on the component.
- Create/install a
PropertyChangeListeneron the component in order to detect and respond to component property changes appropriately. - Install keyboard UI (mnemonics, traversal, etc.) on the component.
- Initialize any appropriate instance data.
- Overrides:
installUIin classComponentUI- Parameters:
c- the component where this UI delegate is being installed- See Also:
ComponentUI.uninstallUI(javax.swing.JComponent),JComponent.setUI(javax.swing.plaf.ComponentUI),JComponent.updateUI()
-
uninstallUI
public void uninstallUI(JComponent c)
Description copied from class:ComponentUIReverses configuration which was done on the specified component duringinstallUI. This method is invoked when thisUIComponentinstance is being removed as the UI delegate for the specified component. This method should undo the configuration performed ininstallUI, being careful to leave theJComponentinstance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:- Remove any UI-set borders from the component.
- Remove any UI-set layout managers on the component.
- Remove any UI-added sub-components from the component.
- Remove any UI-added event/property listeners from the component.
- Remove any UI-installed keyboard UI from the component.
- Nullify any allocated instance data objects to allow for GC.
- Overrides:
uninstallUIin classComponentUI- Parameters:
c- the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- See Also:
ComponentUI.installUI(javax.swing.JComponent),JComponent.updateUI()
-
installDefaults
protected void installDefaults(JComponent c)
-
uninstallDefaults
protected void uninstallDefaults(JComponent c)
-
installListeners
protected void installListeners(JComponent c)
-
uninstallListeners
protected void uninstallListeners(JComponent c)
-
paint
public void paint(Graphics g, JComponent c)
Description copied from class:ComponentUIPaints the specified component appropriately for the look and feel. This method is invoked from theComponentUI.updatemethod when the specified component is being painted. Subclasses should override this method and use the specifiedGraphicsobject to render the content of the component.- Overrides:
paintin classComponentUI- Parameters:
g- theGraphicscontext in which to paintc- the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- See Also:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
-
getPreferredSize
public Dimension getPreferredSize(JComponent c)
Description copied from class:ComponentUIReturns the specified component's preferred size appropriate for the look and feel. Ifnullis returned, the preferred size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method returnsnull.- Overrides:
getPreferredSizein classComponentUI- Parameters:
c- the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- See Also:
JComponent.getPreferredSize(),LayoutManager.preferredLayoutSize(java.awt.Container)
-
getMinimumSize
public Dimension getMinimumSize(JComponent c)
Description copied from class:ComponentUIReturns the specified component's minimum size appropriate for the look and feel. Ifnullis returned, the minimum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokesgetPreferredSizeand returns that value.- Overrides:
getMinimumSizein classComponentUI- Parameters:
c- the component whose minimum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- Returns:
- a
Dimensionobject ornull - See Also:
JComponent.getMinimumSize(),LayoutManager.minimumLayoutSize(java.awt.Container),ComponentUI.getPreferredSize(javax.swing.JComponent)
-
getMaximumSize
public Dimension getMaximumSize(JComponent c)
Description copied from class:ComponentUIReturns the specified component's maximum size appropriate for the look and feel. Ifnullis returned, the maximum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokesgetPreferredSizeand returns that value.- Overrides:
getMaximumSizein classComponentUI- Parameters:
c- the component whose maximum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- Returns:
- a
Dimensionobject ornull - See Also:
JComponent.getMaximumSize(),LayoutManager2.maximumLayoutSize(java.awt.Container)
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
09/10/2025 23:18:21 Cette version de la page est en cache (à la date du 09/10/2025 23:18:21) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 01/09/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/swing/plaf/basic/BasicToolTipUI.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.