public class MetalComboBoxButton extends JButton
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™ has been added to the java.beans
package. Please see XMLEncoder
.
MetalComboBoxButton
JButton.AccessibleJButton
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
protected JComboBox comboBox
protected JList listBox
protected CellRendererPane rendererPane
protected Icon comboIcon
protected boolean iconOnly
public MetalComboBoxButton(JComboBox cb, Icon i, CellRendererPane pane, JList list)
public MetalComboBoxButton(JComboBox cb, Icon i, boolean onlyIcon, CellRendererPane pane, JList list)
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()
Description copied from class: Component
Returns whether this Component
can become the focus owner.
isFocusTraversable
in class Component
true
if this Component
is focusable; false
otherwiseComponent.setFocusable(boolean)
public void setEnabled(boolean enabled)
Description copied from class: AbstractButton
Enables (or disables) the button.
setEnabled
in class AbstractButton
enabled
- true to enable the button, otherwise falseComponent.isEnabled()
, Component.isLightweight()
public void paintComponent(Graphics g)
Description copied from class: JComponent
Calls the UI delegate's paint method, if the UI delegate is non-null
. We pass the delegate a copy of the Graphics
object to protect the rest of the paint code from irrevocable changes (for example, Graphics.translate
).
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.
paintComponent
in class JComponent
g
- the Graphics
object to protectJComponent.paint(java.awt.Graphics)
, ComponentUI
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.
getMinimumSize
in class JComponent
minimumSize
propertyJComponent.setMinimumSize(java.awt.Dimension)
, ComponentUI
© 1993–2017, 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.