JDeveloper java2d ClassCastException