use update() instead of repaint(); get rid of useless window attributes