java.lang.Object | +--com.sun.kjava.TextBox
A box displaying text on the screen. This class flows the text in the box. It doesn't break words, and therefore isn't graceful handling words larger than the width of the box.
Field Summary | |
protected Graphics |
g
|
protected int |
height
|
protected static int |
heightM
|
protected IntVector |
lineEnds
|
protected IntVector |
lineStarts
|
protected java.lang.String |
text
|
protected int |
width
|
protected static int |
widthM
|
protected int |
xPos
|
protected int |
yPos
|
Constructor Summary | |
TextBox()
Create a new TextBox object. |
|
TextBox(java.lang.String t,
int x,
int y,
int w,
int h)
Create a new TextBox object. |
Method Summary | |
int |
getNumLines()
How many lines of text does the TextBox currently hold? |
void |
paint()
Paint the TextBox on the screen. |
void |
setBounds(int x,
int y,
int w,
int h)
Reset the display bounds of the TextBox. |
void |
setText(java.lang.String t)
Set the text. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.lang.String text
protected IntVector lineStarts
protected IntVector lineEnds
protected int xPos
protected int yPos
protected int width
protected int height
protected Graphics g
protected static int widthM
protected static int heightM
Constructor Detail |
public TextBox()
public TextBox(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 int getNumLines()
public void setText(java.lang.String t)
t
- a String representing the new text.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 paint()