simplified paintComponent code