jMobileCore toolkit

com.jmobilecore.ui.core
Class SimpleCheckbox

java.lang.Object
  extended by com.jmobilecore.ui.core.Component
      extended by com.jmobilecore.ui.core.Label
          extended by 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.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

state

public boolean state
The state of the Checkbox.

Constructor Detail

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 label
state - 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 label
state - the initial state of this check box
Method Detail

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

jMobileCore toolkit