The size of the TextPanel object.
private Point cursor
The location of where the next letter will appear.
private Vector text
A list of TextString objects. It stores the contents of the text that is to be displayed in the panel.
private Font f
The font used in the panel.
private FontMetrics fm
A tool that is used to get information about a particular font. Information such as size.
private int lineSpacing
The space between each line.
private ScrollPane scrollBar
The scroll bar for the TextPanel.
Creates an empty TextPanel
Returns the size of the TextPanel.
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.
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.
public void paint(Graphics g)
Draw the text.