public void paint(Graphics g)
{
...
}

invokes a method, called paint.