Class MetalLabelUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.LabelUI
javax.swing.plaf.basic.BasicLabelUI
javax.swing.plaf.metal.MetalLabelUI
- All Implemented Interfaces:
-
PropertyChangeListener
,EventListener
public class MetalLabelUI extends BasicLabelUI
A Windows L&F implementation of LabelUI. This implementation is completely static, i.e. there's only one UIView implementation that's shared by all JLabel objects.
Field Summary
Modifier and Type | Field | Description |
---|---|---|
protected static MetalLabelUI |
metalLabelUI |
The default MetalLabelUI instance. |
Fields declared in class javax.swing.plaf.basic.BasicLabelUI
labelUI
Constructor Summary
Constructor | Description |
---|---|
MetalLabelUI() |
Constructs a MetalLabelUI . |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
static ComponentUI |
createUI |
Returns an instance of MetalLabelUI . |
protected void |
paintDisabledText |
Just paint the text gray (Label.disabledForeground) rather than in the labels foreground color. |
Methods declared in class javax.swing.plaf.basic.BasicLabelUI
getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, installComponents, installDefaults, installKeyboardActions, installListeners, layoutCL, paint, paintEnabledText, propertyChange, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners
Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getPreferredSize, installUI, uninstallUI, update
Field Details
metalLabelUI
protected static MetalLabelUI metalLabelUI
The default
MetalLabelUI
instance. This field might not be used. To change the default instance use a subclass which overrides the createUI
method, and place that class name in defaults table under the key "LabelUI".Constructor Details
MetalLabelUI
public MetalLabelUI()
Constructs a
MetalLabelUI
.Method Details
createUI
public static ComponentUI createUI(JComponent c)
Returns an instance of
MetalLabelUI
.- Parameters:
-
c
- a component - Returns:
- an instance of
MetalLabelUI
paintDisabledText
protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
Just paint the text gray (Label.disabledForeground) rather than in the labels foreground color.
- Overrides:
-
paintDisabledText
in classBasicLabelUI
- Parameters:
-
l
- an instance ofJLabel
-
g
- an instance ofGraphics
-
s
- a text -
textX
- an X coordinate -
textY
- an Y coordinate - See Also:
© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/plaf/metal/MetalLabelUI.html