|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmobilecore.ui.core.Component
com.jmobilecore.ui.core.Label
com.jmobilecore.ui.core.Checkbox
public class Checkbox
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."
Field Summary | |
---|---|
CheckboxGroup |
group
The check box group. |
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 | |
---|---|
Checkbox(java.lang.String label,
boolean state)
Creates a check box with the specified label and sets the specified state. |
|
Checkbox(java.lang.String label,
javax.microedition.lcdui.Font font,
boolean state)
Creates a check box with the specified label and sets the specified state. |
|
Checkbox(java.lang.String label,
javax.microedition.lcdui.Font font,
boolean state,
CheckboxGroup group)
Constructs a Checkbox with the specified label, set to the specified state, and in the specified check box group. |
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. |
void |
setCheckboxGroup(CheckboxGroup g)
Sets this check box's group to be the specified check box group. |
void |
setState(boolean state)
Sets the state of this check box to the specified state. |
Methods inherited from class com.jmobilecore.ui.core.Label |
---|
createTitleLabel, getText, setText |
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 |
Field Detail |
---|
public CheckboxGroup group
public boolean state
Checkbox
.
Constructor Detail |
---|
public Checkbox(java.lang.String label, boolean state)
label
- a string label for this check box,
or null
for no labelstate
- the initial state of this check boxpublic Checkbox(java.lang.String label, javax.microedition.lcdui.Font font, boolean state)
label
- a string label for this check box,
or null
for no labelstate
- the initial state of this check boxpublic Checkbox(java.lang.String label, javax.microedition.lcdui.Font font, boolean state, CheckboxGroup group)
label
- a string label for this check box,
or null
for no label.state
- the initial state of this check box.group
- a check box group for this check box,
or null
for no group.Method Detail |
---|
public boolean keyPressed(int keyCode)
keyPressed
in class Component
keyCode
- The pressed key.public void paint(javax.microedition.lcdui.Graphics g)
paint
in class Label
g
- The Graphics objectpublic void setCheckboxGroup(CheckboxGroup g)
true
and the new
group already has a check box selected, this check box's state
is changed to false
.
g
- the new check box group, or null
to remove this check box from any check box group.public void setState(boolean state)
true
indicates the "on" state,
and false
indicates the "off" state.
state
- the boolean state of the check box
|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |