java.lang.Object | +--com.sun.kjava.TextBox | +--com.sun.kjava.ScrollTextBox
A scrolling TextBox object. You need to control this class from a registered Spotlet. In the Spotlet class, implement penDown(), penMove() and keyDown() to call the handlePenDown(), handlePenMove() and handleKeyDown() methods of this class.
Fields inherited from class com.sun.kjava.TextBox |
g,
height,
heightM,
lineEnds,
lineStarts,
text,
width,
widthM,
xPos,
yPos |
Constructor Summary | |
protected |
ScrollTextBox()
|
|
ScrollTextBox(java.lang.String t,
int x,
int y,
int w,
int h)
Create a new ScrollTextBox object. |
Method Summary | |
boolean |
contains(int x,
int y)
Is this point inside the bounds of the object? |
void |
handleKeyDown(int keyCode)
The user pressed a key. |
void |
handlePenDown(int x,
int y)
The pen has gone down at (x, y). |
void |
handlePenMove(int x,
int y)
The pen has moved at (x, y). |
protected void |
init()
Initialize the object. |
void |
paint()
Paint the ScrollTextBox. |
void |
setBounds(int x,
int y,
int w,
int h)
Reset the display bounds of the ScrollTextBox. |
void |
setScrollValue(int val)
Set the current scroll value and repaint. |
void |
setText(java.lang.String t)
Set the text. |
Methods inherited from class com.sun.kjava.TextBox |
getNumLines |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
protected ScrollTextBox()
public ScrollTextBox(java.lang.String t, int x, int y, int w, int h)
t
- the initial textx
- the X coordinate of the ScrollTextBox's positiony
- the Y coordinate of the ScrollTextBox's positionw
- the widthh
- the heightMethod Detail |
public void setBounds(int x, int y, int w, int h)
x
- the new X coordinate of the ScrollTextBox's positiony
- the new Y coordinate of the ScrollTextBox's positionw
- the new widthh
- the new heightpublic void setText(java.lang.String t)
t
- a String representing the new text.protected void init()
public boolean contains(int x, int y)
x
- the X coordinate of the position to testy
- the Y coordinate of the position to testpublic void handlePenDown(int x, int y)
x
- the X coordinate of the pen positiony
- the Y coordinate of the pen positionpublic void handlePenMove(int x, int y)
x
- the X coordinate of the pen positiony
- the Y coordinate of the pen positionpublic void handleKeyDown(int keyCode)
keyCode
- a code representing the key the user pressedpublic void paint()
public void setScrollValue(int val)
val
- the new scroll value.