Class MetalComboBoxUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ComboBoxUI
-
- javax.swing.plaf.basic.BasicComboBoxUI
-
- javax.swing.plaf.metal.MetalComboBoxUI
public class MetalComboBoxUI extends BasicComboBoxUI
Metal UI for JComboBox
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 XMLEncoder.
- See Also:
-
MetalComboBoxEditor,MetalComboBoxButton
Nested Classes
| Modifier and Type | Class | Description |
|---|---|---|
class | MetalComboBoxUI.MetalComboBoxLayoutManager | This class should be treated as a "protected" inner class. |
class | MetalComboBoxUI.MetalComboPopup | Deprecated. As of Java 2 platform v1.4. |
class | MetalComboBoxUI.MetalPropertyChangeListener | This class should be treated as a "protected" inner class. |
Nested classes/interfaces declared in class javax.swing.plaf.basic.BasicComboBoxUI
BasicComboBoxUI.ComboBoxLayoutManager, BasicComboBoxUI.FocusHandler, BasicComboBoxUI.ItemHandler, BasicComboBoxUI.KeyHandler, BasicComboBoxUI.ListDataHandler, BasicComboBoxUI.PropertyChangeHandler Fields
Fields declared in class javax.swing.plaf.basic.BasicComboBoxUI
arrowButton, cachedMinimumSize, comboBox, currentValuePane, editor, focusListener, hasFocus, isMinimumSizeDirty, itemListener, keyListener, listBox, listDataListener, padding, popup, popupKeyListener, popupMouseListener, popupMouseMotionListener, propertyChangeListener, squareButton Constructors
| Constructor | Description |
|---|---|
MetalComboBoxUI() |
Methods
| Modifier and Type | Method | Description |
|---|---|---|
static ComponentUI | createUI(JComponent c) | Constructs an instance of |
protected void | editablePropertyChanged(PropertyChangeEvent e) | Deprecated. As of Java 2 platform v1.4. |
int | getBaseline(JComponent c,
int width,
int height) | Returns the baseline. |
void | layoutComboBox(Container parent,
MetalComboBoxUI.MetalComboBoxLayoutManager manager) | Lays out the |
void | paintCurrentValue(Graphics g,
Rectangle bounds,
boolean hasFocus) | If necessary paints the currently selected item. |
void | paintCurrentValueBackground(Graphics g,
Rectangle bounds,
boolean hasFocus) | If necessary paints the background of the currently selected item. |
protected void | removeListeners() | Deprecated. As of Java 2 platform v1.4. |
Methods declared in class javax.swing.plaf.basic.BasicComboBoxUI
addEditor, configureArrowButton, configureEditor, createArrowButton, createEditor, createFocusListener, createItemListener, createKeyListener, createLayoutManager, createListDataListener, createPopup, createPropertyChangeListener, createRenderer, getBaselineResizeBehavior, getDefaultSize, getDisplaySize, getInsets, getMinimumSize, getSizeForComponent, installComponents, installDefaults, installKeyboardActions, installListeners, isFocusTraversable, isNavigationKey, isPopupVisible, rectangleForCurrentValue, removeEditor, selectNextPossibleValue, selectPreviousPossibleValue, setPopupVisible, toggleOpenClose, unconfigureArrowButton, unconfigureEditor, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getPreferredSize, installUI, paint, uninstallUI, update Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Constructors
MetalComboBoxUI
public MetalComboBoxUI()
Methods
createUI
public static ComponentUI createUI(JComponent c)
Constructs an instance of MetalComboBoxUI.
- Parameters:
-
c- a component - Returns:
- an instance of
MetalComboBoxUI
paintCurrentValue
public void paintCurrentValue(Graphics g,
Rectangle bounds,
boolean hasFocus) If necessary paints the currently selected item.
- Overrides:
-
paintCurrentValuein classBasicComboBoxUI - Parameters:
-
g- Graphics to paint to -
bounds- Region to paint current value to -
hasFocus- whether or not the JComboBox has focus - Throws:
-
NullPointerException- if any of the arguments are null. - Since:
- 1.5
paintCurrentValueBackground
public void paintCurrentValueBackground(Graphics g,
Rectangle bounds,
boolean hasFocus) If necessary paints the background of the currently selected item.
- Overrides:
-
paintCurrentValueBackgroundin classBasicComboBoxUI - Parameters:
-
g- Graphics to paint to -
bounds- Region to paint background to -
hasFocus- whether or not the JComboBox has focus - Throws:
-
NullPointerException- if any of the arguments are null. - Since:
- 1.5
getBaseline
public int getBaseline(JComponent c,
int width,
int height) Returns the baseline.
- Overrides:
-
getBaselinein classBasicComboBoxUI - Parameters:
-
c-JComponentbaseline is being requested for -
width- the width to get the baseline for -
height- the height to get the baseline for - Returns:
- baseline or a value < 0 indicating there is no reasonable baseline
- Throws:
-
NullPointerException- ifcisnull -
IllegalArgumentException- if width or height is < 0 - Since:
- 1.6
- See Also:
JComponent.getBaseline(int, int)
editablePropertyChanged
@Deprecated protected void editablePropertyChanged(PropertyChangeEvent e)
As of Java 2 platform v1.4 this method is no longer used. Do not call or override. All the functionality of this method is in the MetalPropertyChangeListener.
- Parameters:
-
e- an instance ofPropertyChangeEvent
layoutComboBox
public void layoutComboBox(Container parent,
MetalComboBoxUI.MetalComboBoxLayoutManager manager) Lays out the JComboBox in the parent container.
- Parameters:
-
parent- a container -
manager- an instance ofMetalComboBoxLayoutManager
removeListeners
@Deprecated protected void removeListeners()
As of Java 2 platform v1.4 this method is no longer used.
© 1993, 2020, 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/11/docs/api/java.desktop/javax/swing/plaf/metal/MetalComboBoxUI.html