The size of the TextPanel object.
cursor
private Point cursor
The location of where the next letter will appear.
text
private Vector text
A list of TextString objects. It stores the contents of the text that is to be displayed in the panel.
f
private Font f
The font used in the panel.
fm
private FontMetrics fm
A tool that is used to get information about a particular font. Information such as size.
lineSpacing
private int lineSpacing
The space between each line.
scrollBar
private ScrollPane scrollBar
The scroll bar for the TextPanel.
Creates an empty TextPanel
object.
Returns the size of the TextPanel.
append
public void append(String string, Color color)
Creates a TextString object out of the method parameters and append the text at the location pointed by the cursor.
appendNewLine
public void appendNewLine(String string, Color color)
The same as the append method except the cursor is moved to beginning of the next line before appending the text.
paint
public void paint(Graphics g)
Draw the text.