Palm API
Beta 2

com.sun.kjava
Class Caret

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--com.sun.kjava.Caret

public class Caret
extends java.lang.Thread

Class Caret implements a caret ("|") for use as a marker for the current insertion point in a TextField. (Caret should probably be a private class, since it has no use independent of TextField.)


Field Summary
 boolean blinking
           
 boolean stop
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Caret(int delay, int x, int y)
          Create a Caret at a position, blinking at a given rate.
 
Method Summary
 void drawCaret(int drawMode)
          Draw the Caret at its current position.
 void eraseCaret()
           
 void run()
          Run: flash the Caret at the prescribed rate.
 void setPosition(int x, int y)
          Set the Caret's position.
 
Methods inherited from class java.lang.Thread
activeCount, currentThread, getPriority, isAlive, join, setPriority, sleep, start, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

blinking

public boolean blinking

stop

public boolean stop
Constructor Detail

Caret

public Caret(int delay,
             int x,
             int y)
Create a Caret at a position, blinking at a given rate.
Parameters:
x - X coordinate of position
y - Y coordinate of position
delay - delay between blinks, in milliseconds
Method Detail

setPosition

public void setPosition(int x,
                        int y)
Set the Caret's position.
Parameters:
x - new X coordinate
y - new Y coordinate

eraseCaret

public void eraseCaret()

drawCaret

public void drawCaret(int drawMode)
Draw the Caret at its current position.
Parameters:
drawMode - mode in which to draw

run

public void run()
Run: flash the Caret at the prescribed rate.
Overrides:
run in class java.lang.Thread
Tags copied from class: java.lang.Thread
See Also:
Thread.start(), Runnable.run()

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.