com.jmobilecore.ui.core
Class SimpleCheckbox
java.lang.Object
com.jmobilecore.ui.core.Component
com.jmobilecore.ui.core.Label
com.jmobilecore.ui.core.SimpleCheckbox
- Direct Known Subclasses:
- ListCheckbox
public class SimpleCheckbox
- extends Label
A check box is a graphical component that can be in either an
"on" (true
) or "off" (false
) state.
Clicking on a check box changes its state from
"on" to "off," or from "off" to "on."
This object cannot be included into CheckboxGroup
object
- Author:
- Greg Gridin
Field Summary |
boolean |
state
The state of the Checkbox . |
Fields inherited from class com.jmobilecore.ui.core.Label |
text |
Fields inherited from class com.jmobilecore.ui.core.Component |
alignment, background, CENTER, focusable, focusedBackground, focusedForeground, font, foreground, height, isCompletelyVisible, isFocused, isVisible, LEFT, parentScreen, RIGHT, screenY, valid, width |
Constructor Summary |
SimpleCheckbox(java.lang.String label,
boolean state)
Creates a check box with the specified label
and sets the specified state. |
SimpleCheckbox(java.lang.String label,
javax.microedition.lcdui.Font font,
boolean state)
Creates a check box with the specified label
and sets the specified state. |
Method Summary |
boolean |
keyPressed(int keyCode)
Responds to key presses when the button has focus. |
void |
paint(javax.microedition.lcdui.Graphics g)
Paints the checkbox to the screen. |
Methods inherited from class com.jmobilecore.ui.core.Component |
destructor, getBackground, getFont, getForeground, getHeight, getWidth, invalidate, isFocusOwner, keyReleased, keyRepeated, paintBackground, pointerDragged, pointerPressed, pointerReleased, prepareForeground, releaseFocus, requestFocus, setFont, setHeight |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
state
public boolean state
- The state of the
Checkbox
.
SimpleCheckbox
public SimpleCheckbox(java.lang.String label,
boolean state)
- Creates a check box with the specified label
and sets the specified state.
- Parameters:
label
- a string label for this check box,
or null
for no labelstate
- the initial state of this check box
SimpleCheckbox
public SimpleCheckbox(java.lang.String label,
javax.microedition.lcdui.Font font,
boolean state)
- Creates a check box with the specified label
and sets the specified state.
- Parameters:
label
- a string label for this check box,
or null
for no labelstate
- the initial state of this check box
keyPressed
public boolean keyPressed(int keyCode)
- Responds to key presses when the button has focus.
- Overrides:
keyPressed
in class Component
- Parameters:
keyCode
- The pressed key.
paint
public void paint(javax.microedition.lcdui.Graphics g)
- Paints the checkbox to the screen.
- Overrides:
paint
in class Label
- Parameters:
g
- The Graphics object