JavaTM 2 Platform
Std. Ed. v1.3.1

javax.swing.plaf.metal
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. A future release of Swing will provide support for long term persistence.

See Also:
MetalComboBoxListCellRenderer, MetalPopupMenuBorder

Inner Class Summary
 class MetalComboBoxUI.MetalComboBoxLayoutManager
          This inner class is marked "public" due to a compiler bug.
 class MetalComboBoxUI.MetalComboPopup
          This inner class is marked "public" due to a compiler bug.
 class MetalComboBoxUI.MetalPropertyChangeListener
          This inner class is marked "public" due to a compiler bug.
 
Inner classes inherited from class javax.swing.plaf.basic.BasicComboBoxUI
BasicComboBoxUI.ComboBoxLayoutManager, BasicComboBoxUI.FocusHandler, BasicComboBoxUI.ItemHandler, BasicComboBoxUI.KeyHandler, BasicComboBoxUI.ListDataHandler, BasicComboBoxUI.PropertyChangeHandler
 
Fields inherited from class javax.swing.plaf.basic.BasicComboBoxUI
arrowButton, cachedMinimumSize, comboBox, currentValuePane, editor, focusListener, hasFocus, isMinimumSizeDirty, itemListener, keyListener, listBox, listDataListener, popup, popupKeyListener, popupMouseListener, popupMouseMotionListener, propertyChangeListener
 
Constructor Summary
MetalComboBoxUI()
           
 
Method Summary
 void configureArrowButton()
          Configures the arrow button by adding listeners.
 void configureEditor()
          Configures the editor by setting its font and adding listeners.
protected  JButton createArrowButton()
          Creates the arrow button.
protected  ComboBoxEditor createEditor()
          Creates the editor that is to be used in editable combo boxes.
protected  LayoutManager createLayoutManager()
          Creates the standard combo box layout manager that has the arrow button to the right and the editor to the left.
protected  ComboPopup createPopup()
          Creates an implementation of the ComboPopup interface.
 PropertyChangeListener createPropertyChangeListener()
          Creates the list data listener that is used for caching the preferred sizes.
static ComponentUI createUI(JComponent c)
           
protected  void editablePropertyChanged(PropertyChangeEvent e)
           
 Dimension getMinimumSize(JComponent c)
           
protected  void installListeners()
          Attaches listeners to the JComboBox and JComboBoxModel.
 void installUI(JComponent c)
           
 boolean isFocusTraversable(JComboBox c)
          Determines if the JComboBox is focus traversable.
 void layoutComboBox(Container parent, MetalComboBoxUI.MetalComboBoxLayoutManager manager)
           
 void paint(Graphics g, JComponent c)
           
protected  void removeListeners()
           
protected  void selectNextPossibleValue()
          Selects the next item in the list.
protected  void selectPreviousPossibleValue()
          Selects the previous item in the list.
 void unconfigureArrowButton()
          Unconfigures the arrow button by removing listeners.
 void unconfigureEditor()
          Unconfigures the editor by removing listeners.
protected  void uninstallListeners()
          Removes listeners from the JComboBox and JComboBoxModel.
 void uninstallUI(JComponent c)
           
 
Methods inherited from class javax.swing.plaf.basic.BasicComboBoxUI
addEditor, createFocusListener, createItemListener, createKeyListener, createListDataListener, createRenderer, getAccessibleChild, getAccessibleChildrenCount, getDefaultSize, getDisplaySize, getInsets, getMaximumSize, getPreferredSize, installComponents, installDefaults, installKeyboardActions, isNavigationKey, isPopupVisible, paintCurrentValue, paintCurrentValueBackground, rectangleForCurrentValue, removeEditor, setPopupVisible, toggleOpenClose, uninstallComponents, uninstallDefaults, uninstallKeyboardActions
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetalComboBoxUI

public MetalComboBoxUI()
Method Detail

createUI

public static ComponentUI createUI(JComponent c)

installUI

public void installUI(JComponent c)
Overrides:
installUI in class BasicComboBoxUI

uninstallUI

public void uninstallUI(JComponent c)
Overrides:
uninstallUI in class BasicComboBoxUI

paint

public void paint(Graphics g,
                  JComponent c)
Overrides:
paint in class BasicComboBoxUI

createEditor

protected ComboBoxEditor createEditor()
Description copied from class: BasicComboBoxUI
Creates the editor that is to be used in editable combo boxes. This method only gets called if a custom editor has not already been installed in the JComboBox.
Overrides:
createEditor in class BasicComboBoxUI

createPopup

protected ComboPopup createPopup()
Description copied from class: BasicComboBoxUI
Creates an implementation of the ComboPopup interface. Returns an instance of BasicComboPopup.
Overrides:
createPopup in class BasicComboBoxUI

createArrowButton

protected JButton createArrowButton()
Description copied from class: BasicComboBoxUI
Creates the arrow button. Subclasses can create any button they like. The default behavior of this class is to attach various listeners to the button returned by this method. Returns an instance of BasicArrowButton.
Overrides:
createArrowButton in class BasicComboBoxUI

createPropertyChangeListener

public PropertyChangeListener createPropertyChangeListener()
Description copied from class: BasicComboBoxUI
Creates the list data listener that is used for caching the preferred sizes. Returns an instance of BasicComboBoxUI$PropertyChangeHandler.
Overrides:
createPropertyChangeListener in class BasicComboBoxUI

editablePropertyChanged

protected void editablePropertyChanged(PropertyChangeEvent e)

createLayoutManager

protected LayoutManager createLayoutManager()
Description copied from class: BasicComboBoxUI
Creates the standard combo box layout manager that has the arrow button to the right and the editor to the left. Returns an instance of BasicComboBoxUI$ComboBoxLayoutManager.
Overrides:
createLayoutManager in class BasicComboBoxUI

layoutComboBox

public void layoutComboBox(Container parent,
                           MetalComboBoxUI.MetalComboBoxLayoutManager manager)

isFocusTraversable

public boolean isFocusTraversable(JComboBox c)
Description copied from class: BasicComboBoxUI
Determines if the JComboBox is focus traversable. If the JComboBox is editable this returns false, otherwise it returns true.
Overrides:
isFocusTraversable in class BasicComboBoxUI

installListeners

protected void installListeners()
Description copied from class: BasicComboBoxUI
Attaches listeners to the JComboBox and JComboBoxModel.
Overrides:
installListeners in class BasicComboBoxUI

uninstallListeners

protected void uninstallListeners()
Description copied from class: BasicComboBoxUI
Removes listeners from the JComboBox and JComboBoxModel.
Overrides:
uninstallListeners in class BasicComboBoxUI

removeListeners

protected void removeListeners()

configureEditor

public void configureEditor()
Description copied from class: BasicComboBoxUI
Configures the editor by setting its font and adding listeners.
Overrides:
configureEditor in class BasicComboBoxUI

unconfigureEditor

public void unconfigureEditor()
Description copied from class: BasicComboBoxUI
Unconfigures the editor by removing listeners.
Overrides:
unconfigureEditor in class BasicComboBoxUI

configureArrowButton

public void configureArrowButton()
Description copied from class: BasicComboBoxUI
Configures the arrow button by adding listeners.
Overrides:
configureArrowButton in class BasicComboBoxUI

unconfigureArrowButton

public void unconfigureArrowButton()
Description copied from class: BasicComboBoxUI
Unconfigures the arrow button by removing listeners.
Overrides:
unconfigureArrowButton in class BasicComboBoxUI

getMinimumSize

public Dimension getMinimumSize(JComponent c)
Overrides:
getMinimumSize in class BasicComboBoxUI

selectNextPossibleValue

protected void selectNextPossibleValue()
Description copied from class: BasicComboBoxUI
Selects the next item in the list. It won't change the selection if the currently selected item is already the last item.
Overrides:
selectNextPossibleValue in class BasicComboBoxUI

selectPreviousPossibleValue

protected void selectPreviousPossibleValue()
Description copied from class: BasicComboBoxUI
Selects the previous item in the list. It won't change the selection if the currently selected item is already the first item.
Overrides:
selectPreviousPossibleValue in class BasicComboBoxUI

JavaTM 2 Platform
Std. Ed. v1.3.1

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.