Exercise P2 14

In order to create an Ellipse with a height and width of the Frame it resides in, you should create the Ellipse in the following manner:

Ellipse2D.Double myEllipse = new Ellipse2D.Double(0, 0, getWidth(), getHeight());

The getWidth() and getHeight() methods return the width and height of the frame.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License