|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
A button used by the MetalComboBoxUI
class.
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.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected JComboBox |
comboBox
A reference to the JComboBox that the button belongs to. |
protected Icon |
comboIcon
The button icon. |
protected boolean |
iconOnly
Display just the icon, or the icon plus the label. |
protected JList |
listBox
A reference to the JList. |
protected CellRendererPane |
rendererPane
Used for rendering the selected item. |
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)
Creates a new button. |
|
MetalComboBoxButton(JComboBox cb,
Icon i,
CellRendererPane pane,
JList list)
Creates a new button. |
Method Summary | |
---|---|
JComboBox |
getComboBox()
Returns the combo box that the button is used with. |
Icon |
getComboIcon()
Returns the icon displayed by the button. |
boolean |
isFocusTraversable()
Returns false , to indicate that this component is not part
of the focus traversal group. |
boolean |
isIconOnly()
Returns a flag that controls whether the button displays an icon only, or text as well. |
void |
paintComponent(Graphics g)
Paints the component. |
void |
setComboBox(JComboBox cb)
Sets the combo box that the button is used with. |
void |
setComboIcon(Icon i)
Sets the icon displayed by the button. |
void |
setEnabled(boolean enabled)
Enables or disables the button. |
void |
setIconOnly(boolean isIconOnly)
Sets the flag that controls whether the button displays an icon only, or text as well. |
Methods inherited from class javax.swing.JButton |
---|
configurePropertiesFromAction, getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable, updateUI |
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)
cb
- the combo that the button is used for (null
not
permitted).i
- the icon displayed on the button.pane
- the rendering pane.list
- the list.public MetalComboBoxButton(JComboBox cb, Icon i, boolean onlyIcon, CellRendererPane pane, JList list)
cb
- the combo that the button is used for (null
not
permitted).i
- the icon displayed on the button.onlyIcon
- a flag that specifies whether the button displays only an
icon, or text as well.pane
- the rendering pane.list
- the list.Method Detail |
---|
public final JComboBox getComboBox()
public final void setComboBox(JComboBox cb)
cb
- the combo box.public final Icon getComboIcon()
MetalComboBoxIcon
.
public final void setComboIcon(Icon i)
i
- the icon.public final boolean isIconOnly()
public final void setIconOnly(boolean isIconOnly)
isIconOnly
- the flag.public boolean isFocusTraversable()
false
, to indicate that this component is not part
of the focus traversal group.
isFocusTraversable
in class Component
false
Component.setFocusable(boolean)
public void setEnabled(boolean enabled)
setEnabled
in class AbstractButton
enabled
- the new status.Component.isEnabled()
,
Component.isLightweight()
public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- the graphics device.JComponent.paint(java.awt.Graphics)
,
JComponent.paintBorder(java.awt.Graphics)
,
JComponent.paintChildren(java.awt.Graphics)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |