net.yura.mobile.gui.components
Class Button
java.lang.Object
net.yura.mobile.gui.components.Component
net.yura.mobile.gui.components.Label
net.yura.mobile.gui.components.Button
- All Implemented Interfaces:
- ActionListener
- Direct Known Subclasses:
- ButtonEditor, ComboBox, Menu, RadioButton
public class Button
- extends Label
- implements ActionListener
- Author:
- Yura Mamyrin
- See Also:
JButton
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.Label |
getCombinedHeight, getCombinedHeight, getCombinedWidth, getCombinedWidth, getFont, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getMargin, getMaxWidth, getText, getVerticalAlignment, getVerticalTextPosition, paintComponent, paintIcon, setFont, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setMargin, setText, setVerticalAlignment, setVerticalTextPosition, toString, workoutMinimumSize |
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 |
buttonGroup
protected ButtonGroup buttonGroup
Button
public Button()
- See Also:
JButton.JButton
Button
public Button(String label)
- Parameters:
label
- the text of the button- See Also:
JButton.JButton
Button
public Button(String label,
Icon img)
- Parameters:
label
- the text of the buttonimg
- the Icon image to display on the button- See Also:
JButton.JButton
actionPerformed
public void actionPerformed(String actionCommand)
- Specified by:
actionPerformed
in interface ActionListener
- Parameters:
actionCommand
- The Command of the action- See Also:
ActionListener.actionPerformed
addActionListener
public void addActionListener(ActionListener l)
- See Also:
AbstractButton.addActionListener
fireActionPerformed
public void fireActionPerformed()
- See Also:
AbstractButton.fireActionPerformed
focusGained
public void focusGained()
- Overrides:
focusGained
in class Component
- See Also:
FocusListener.focusGained
focusLost
public void focusLost()
- Overrides:
focusLost
in class Component
- See Also:
FocusListener.focusLost
getActionCommand
public String getActionCommand()
- Returns:
- The Action Command for this button
- See Also:
AbstractButton.getActionCommand
getActionListeners
public ActionListener[] getActionListeners()
- See Also:
AbstractButton.getActionListeners
getDefaultName
public String getDefaultName()
- Overrides:
getDefaultName
in class Label
getMnemonic
public int getMnemonic()
- See Also:
AbstractButton.getMnemonic
getState
public int getState()
- Overrides:
getState
in class Component
getValue
public Object getValue()
- Overrides:
getValue
in class Component
getXOnScreen
public int getXOnScreen()
- Overrides:
getXOnScreen
in class Component
- See Also:
Component.getLocationOnScreen
getYOnScreen
public int getYOnScreen()
- Overrides:
getYOnScreen
in class Component
- See Also:
Component.getLocationOnScreen
isSelected
public boolean isSelected()
- See Also:
AbstractButton.isSelected
isUseSelectButton
public boolean isUseSelectButton()
isVisible
public boolean isVisible()
- Overrides:
isVisible
in class Component
- See Also:
Component.isVisible
processKeyEvent
public boolean processKeyEvent(KeyEvent keyEvent)
- Overrides:
processKeyEvent
in class Component
- See Also:
JComponent.processKeyEvent
processMouseEvent
public void processMouseEvent(int type,
int x,
int y,
KeyEvent keys)
- Overrides:
processMouseEvent
in class Component
- See Also:
Component.processMouseEvent
removeActionListener
public void removeActionListener(ActionListener l)
- See Also:
AbstractButton.removeActionListener
setActionCommand
public void setActionCommand(String ac)
- Parameters:
ac
- The Action Command for this button- See Also:
AbstractButton.setActionCommand
setButtonGroup
public void setButtonGroup(ButtonGroup buttonGroup)
setMnemonic
public void setMnemonic(int m)
When set to KeyEvent.KEY_MENU
this will be activated by the 'Alt' key in ME4SE and appear as 'Left SoftKey' of J2ME phones
On Android and blackberry it will be hidden from the layout and activated by the 'MENU' button
When set to KeyEvent.KEY_END
this will be activated by the 'Esc' key in ME4SE and appear as 'Right SoftKey' of J2ME phones
On Android and blackberry it will be hidden from the layout and activated by the 'BACK' button
When set to KeyEvent.KEY_SOFTKEY1
this will be activated by the 'F1' key in ME4SE and appear as 'Left SoftKey' of J2ME phones.
On Android and blackberry nothing special will be done with this button
When set to KeyEvent.KEY_SOFTKEY2
this will be activated by the 'F2' key in ME4SE and appear as 'Right SoftKey' of J2ME phones.
On Android and blackberry nothing special will be done with this button
- See Also:
AbstractButton.setMnemonic
,
KeyEvent.KEY_MENU
,
KeyEvent.KEY_END
,
KeyEvent.KEY_SOFTKEY1
,
KeyEvent.KEY_SOFTKEY2
setSelected
public void setSelected(boolean selected)
- See Also:
AbstractButton.setSelected
setUseSelectButton
public void setUseSelectButton(boolean useSelectButton)
setValue
public void setValue(Object obj)
- Overrides:
setValue
in class Label
toggleSelection
protected void toggleSelection()
- This method is ONLY used when we do NOT have a button group
updateUI
public void updateUI()
- Overrides:
updateUI
in class Label
- See Also:
JComponent.updateUI