public void next(int width, int height) {
    x += incX;
    y += incY;
	float random = (float)Math.random(); 
    if (x + textWidth > width) {
        x = width - textWidth;
        incX = random * -width / 16 - 1;
    }
    if (x < 0) {
        x = 0;
        incX = random * width / 16 + 1;
    }
    if (y + textHeight > height) {
        y = (height - textHeight)- 2;
        incY = random * -height / 16 - 1;
    }
    if (y < 0) {
        y = 0;
        incY = random * height / 16 + 1;
    }
}