initial java file with resizing