is new.
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JButton
javax.swing.plaf.metal.MetalComboBoxButton
public class MetalComboBoxButton
JButton subclass to help out MetalComboBoxUI
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 TM has been added to the java.beans package. Please see XMLEncoder .
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing. JButton |
|---|
| JButton.AccessibleJButton |
| Nested classes/interfaces inherited from class javax.swing. AbstractButton |
|---|
| AbstractButton.AccessibleAbstractButton , AbstractButton.ButtonChangeListener |
| Nested classes/interfaces inherited from class javax.swing. JComponent |
|---|
| JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt. Container |
|---|
| Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt. Component |
|---|
Component.AccessibleAWTComponent
,
Component.BaselineResizeBehavior
,
Component.BltBufferStrategy
,
Component.FlipBufferStrategy
|
| Field Summary | |
|---|---|
| protected JComboBox |
comboBox
|
| protected Icon |
comboIcon
|
| protected boolean |
iconOnly
|
| protected JList |
listBox
|
| protected CellRendererPane |
rendererPane
|
| Fields inherited from class javax.swing. JComponent |
|---|
| accessibleContext , listenerList , TOOL_TIP_TEXT_KEY , ui , UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt. Component |
|---|
| BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT |
| Fields inherited from interface javax.swing. SwingConstants |
|---|
| BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
| Fields inherited from interface java.awt.image. ImageObserver |
|---|
| ABORT , ALLBITS , ERROR , FRAMEBITS , HEIGHT , PROPERTIES , SOMEBITS , WIDTH |
| Constructor Summary | |
|---|---|
|
MetalComboBoxButton
(
JComboBox
cb,
Icon
i, boolean onlyIcon,
CellRendererPane
pane,
JList
list) |
|
|
MetalComboBoxButton
(
JComboBox
cb,
Icon
i,
CellRendererPane
pane,
JList
list) |
|
| Method Summary | |
|---|---|
| JComboBox |
getComboBox
() |
| Icon |
getComboIcon
() |
Dimension
|
getMinimumSize
()
If the minimum size has been set to a non-null value just returns it.
|
| boolean |
isFocusTraversable
() Returns whether this Component can become the focus owner. |
| boolean |
isIconOnly
() |
| void |
paintComponent
(
Graphics
g) Calls the UI delegate's paint method, if the UI delegate is non-null. |
| void |
setComboBox
(
JComboBox
cb) |
| void |
setComboIcon
(
Icon
i) |
| void |
setEnabled
(boolean enabled) Enables (or disables) the button. |
| void |
setIconOnly
(boolean isIconOnly) |
| Methods inherited from class javax.swing. JButton |
|---|
|
| Methods inherited from class java.lang. Object |
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
| Field Detail |
|---|
protected JComboBox comboBox
protected JList listBox
protected CellRendererPane rendererPane
protected Icon comboIcon
protected boolean iconOnly
| Constructor Detail |
|---|
public MetalComboBoxButton(JComboBox cb,
Icon i,
CellRendererPane pane,
JList list)
public MetalComboBoxButton(JComboBox cb,
Icon i,
boolean onlyIcon,
CellRendererPane pane,
JList list)
| Method Detail |
|---|
public final JComboBox getComboBox()
public final void setComboBox(JComboBox cb)
public final Icon getComboIcon()
public final void setComboIcon(Icon i)
public final boolean isIconOnly()
public final void setIconOnly(boolean isIconOnly)
public boolean isFocusTraversable()
public void setEnabled(boolean enabled)
public void paintComponent(Graphics g)
If you override this in a subclass you should not make permanent changes to the passed in Graphics. For example, you should not alter the clip Rectangle or modify the transform. If you need to do these operations you may find it easier to create a new Graphics from the passed in Graphics and manipulate it. Further, if you do not invoker super's implementation you must honor the opaque property, that is if this component is opaque, you must completely fill in the background in a non-opaque color. If you do not honor the opaque property you will likely see visual artifacts.
The passed in Graphics object might have a transform other than the identify transform installed on it. In this case, you might get unexpected results if you cumulatively apply another transform.
getMinimumSize
public
Dimension
getMinimumSize
()
Description copied from class:
JComponent
If the minimum size has been set to a non-null value just returns it. If the UI delegate's getMinimumSize method returns a non-null value then return that; otherwise defer to the component's layout manager.
Overrides:
getMinimumSize
in class
JComponent
Returns:
the value of the minimumSize property
See Also:
JComponent.setMinimumSize(java.awt.Dimension)
,
ComponentUI