Java Fillrect With Border, Code Example In the example above, we created a frame and set its size.