Palm API
Beta 2

com.sun.kjava
Class ValueSelector

java.lang.Object
  |
  +--com.sun.kjava.ValueSelector

public class ValueSelector
extends java.lang.Object

An object that presents a user interface for integer value selection.

It contains three Buttons:


Constructor Summary
ValueSelector(java.lang.String label, int min, int max, int init, int x, int y)
          Create a new ValueSelector.
 
Method Summary
 int getValue()
          What's the current value?
 void paint()
          Paint the ValueSelector.
 boolean pressed(int x, int y)
          If one of the Buttons was pressed, have it deal with it.
 void setValue(int value)
          Set the current value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueSelector

public ValueSelector(java.lang.String label,
                     int min,
                     int max,
                     int init,
                     int x,
                     int y)
Create a new ValueSelector.
Parameters:
label - the label for the ValueSelector
min - minimum value to allow
max - maximum value to allow
init - initial value
x - the X coordinate of our position
y - the Y coordinate of our position
Method Detail

paint

public void paint()
Paint the ValueSelector.

getValue

public int getValue()
What's the current value?
Returns:
the current value

setValue

public void setValue(int value)
Set the current value.
Parameters:
value - the value to set

pressed

public boolean pressed(int x,
                       int y)
If one of the Buttons was pressed, have it deal with it.
Parameters:
x - the X coordinate of the user's press
y - the Y coordinate of the user's press
Returns:
true if the position was handled by one of the Buttons

Submit a bug or feature

The GUI classes provided with this release are NOT part of CLDC, and they will be removed in later releases of this software. Official GUI classes for Java 2 Micro Edition will be defined separately through the Java Community Process and included in J2ME profiles. Java is trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2000 Sun Microsystems, Inc.
901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
All Rights Reserved.