|
Palm API Beta 2 |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.kjava.Button
Button: a simple button user interface object. Note that this button causes actions to occur when it it pressed, not when it is released. Therefore it is currently impossible for a user to cancel a button selection once it has started! Bitmap buttons do not have a border drawn around them. If you want your bitmap button to have a border, include the border in the bitmap.
Field Summary | |
static int |
minWidth
|
Constructor Summary | |
Button(Bitmap bitmap,
int x,
int y)
Create a new Button object with graphical label. |
|
Button(java.lang.String s,
int x,
int y)
Create a new Button object with a text label. |
Method Summary | |
boolean |
isEnabled()
Is the Button enabled? |
void |
paint()
Paint the Button on the global Graphics context. |
boolean |
pressed(int x,
int y)
Was the button pressed? If the coordinates are within the Button, give the user some feedback. |
void |
setEnabled(boolean state)
Set whether the Button allows input (is "enabled"). |
void |
setText(java.lang.String s)
Set the Button's text label. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int minWidth
Constructor Detail |
public Button(java.lang.String s, int x, int y)
s
- the button's text labelx
- the x coordinate of the button's locationy
- the y coordinate of the button's locationpublic Button(Bitmap bitmap, int x, int y)
s
- the button's text labelx
- the x coordinate of the button's locationy
- the y coordinate of the button's locationMethod Detail |
public void setText(java.lang.String s)
s
- the new label for the button.public void setEnabled(boolean state)
state
- if true, Button allows input.public boolean isEnabled()
public void paint()
public boolean pressed(int x, int y)
|
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. |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |