net.yura.mobile.gui.components
Class ComboBox
java.lang.Object
net.yura.mobile.gui.components.Component
net.yura.mobile.gui.components.Label
net.yura.mobile.gui.components.Button
net.yura.mobile.gui.components.ComboBox
- All Implemented Interfaces:
- ActionListener
public class ComboBox
- extends Button
- implements ActionListener
- Author:
- Yura Mamyrin
- See Also:
JComboBox
Fields inherited from class net.yura.mobile.gui.components.Component |
background, empty, FOCUS_GAINED, FOCUS_LOST, focusable, foreground, height, parent, posX, posY, preferredHeight, preferredWidth, state, theme, width |
Methods inherited from class net.yura.mobile.gui.components.Button |
addActionListener, focusGained, focusLost, getActionCommand, getActionListeners, getMnemonic, getState, getXOnScreen, getYOnScreen, isSelected, isUseSelectButton, isVisible, processKeyEvent, processMouseEvent, removeActionListener, setActionCommand, setButtonGroup, setMnemonic, setSelected, setUseSelectButton, toggleSelection |
Methods inherited from class net.yura.mobile.gui.components.Label |
getCombinedHeight, getCombinedHeight, getCombinedWidth, getCombinedWidth, getFont, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getMargin, getMaxWidth, getText, getVerticalAlignment, getVerticalTextPosition, paintIcon, setFont, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setMargin, setVerticalAlignment, setVerticalTextPosition, toString |
Methods inherited from class net.yura.mobile.gui.components.Component |
add, add, add, addFocusListener, addImpl, animate, clip, consumesMotionEvents, getBackground, getBorder, getCurrentState, getDesktopPane, getFocusListeners, getForeground, getHeight, getHeightWithBorder, getInsets, getName, getParent, getPreferredHeight, getPreferredWidth, getToolTipLocationX, getToolTipLocationY, getToolTipText, getWidth, getWidthWithBorder, getWindow, getX, getXWithBorder, getY, getYWithBorder, insert, insert, isComponentVisible, isFocusable, isFocusOwner, isOpaque, isRectVisible, isShowing, makeVisible, paint, paintBorder, processMultitouchEvent, removeFocusListener, removeParent, repaint, requestFocusInWindow, revalidate, scrollRectToVisible, scrollUpDown, setBackground, setBorder, setBounds, setBoundsWithBorder, setFocusable, setForeground, setLocation, setName, setPreferredSize, setSize, setState, setToolTipText, setupState, setVisible, transferFocus, validate, wait, workoutSize |
ComboBox
public ComboBox()
- See Also:
JComboBox.JComboBox
ComboBox
public ComboBox(Vector vec)
- Parameters:
vec
- an vector of objects to insert into the combo box- See Also:
JComboBox.JComboBox
actionPerformed
public void actionPerformed(String actionCommand)
- Specified by:
actionPerformed
in interface ActionListener
- Overrides:
actionPerformed
in class Button
- Parameters:
actionCommand
- The Command of the action- See Also:
ActionListener.actionPerformed
addItem
public void addItem(Object obj)
- See Also:
JComboBox.addItem
fireActionPerformed
public void fireActionPerformed()
- Overrides:
fireActionPerformed
in class Button
- See Also:
AbstractButton.fireActionPerformed
getDefaultName
public String getDefaultName()
- Overrides:
getDefaultName
in class Button
getItemCount
public int getItemCount()
getItems
public Vector getItems()
- return the vector, can not be a true representation of the model
getList
public List getList()
- See Also:
ComboPopup.getList
getNonSelectedImage
public Icon getNonSelectedImage()
getSelectedImage
public Icon getSelectedImage()
getSelectedIndex
public int getSelectedIndex()
- Returns:
- an integer specifying the currently selected list item
- See Also:
JComboBox#getSelectedIndex
getSelectedItem
public Object getSelectedItem()
- Returns:
- the current selected item
- See Also:
JComboBox.getSelectedItem
getValue
public Object getValue()
- Overrides:
getValue
in class Button
paintComponent
public void paintComponent(Graphics2D g)
- Overrides:
paintComponent
in class Label
- See Also:
JComponent.paintComponent
setItems
public void setItems(Vector items)
setLoop
public void setLoop(boolean b)
setModel
public void setModel(List list)
- Parameters:
list
- - See Also:
JComboBox.setModel
setNonSelectedImage
public void setNonSelectedImage(Icon nonSelectedImage)
setScrollMode
public void setScrollMode(int m)
setSelectedImage
public void setSelectedImage(Icon selectedImage)
setSelectedIndex
public void setSelectedIndex(int i)
- Parameters:
i
- - See Also:
JComboBox.setSelectedIndex
setSelectedItem
public void setSelectedItem(Object selected)
- Parameters:
selected
- - See Also:
JComboBox.setSelectedItem
setText
public void setText(String a)
- This throws an IllegalArgumentException and you should use the
setIndex method instead
- Overrides:
setText
in class Label
- Parameters:
a
- The text of the label- See Also:
JLabel.setText
setValue
public void setValue(Object obj)
- Overrides:
setValue
in class Button
updateUI
public void updateUI()
- Overrides:
updateUI
in class Button
- See Also:
JComponent.updateUI
workoutMinimumSize
public void workoutMinimumSize()
- Description copied from class:
Component
- This sets the width and height of this component
to the MINIMUM that is needed for this component
- Overrides:
workoutMinimumSize
in class Label
- See Also:
JComponent.getMinimumSize