protected void paint(Graphics arg0)
{
if (first)
{
arg0.setColor(128, 0, 128);
arg0.fillRect(0, 0, getWidth(), height);
first = false;
}
arg0.setColor(255, 255, 255);
arg0.setFont(font);
arg0.drawString(content[i], slen[i], height / 2, Graphics.LEFT
| Graphics.TOP);
}
private void initSlen()
{
int temp = 10;
for (int i = 0; i < content.length; i++)
{
slen[i] = temp;
temp = temp + font.stringWidth(content[i]);
}
}
private class TypeTask extends TimerTask
{
public void run()
{
if (i < content.length - 1)
{
repaint();
i++;
} else
{
timer.cancel();
}