Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
Ebook
/
Informatique
/
JAVA
/
Source_TLS
/
Move
:
MyOval.java
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
package toto; import java.awt.*; public class MyOval extends MyShape { // constructor public MyOval(int firstX,int firstY,int secondX,int secondY, Color shapeColor ) { super( firstX, firstY, secondX, secondY, shapeColor ); } // end constructor // draw an oval public void draw( Graphics g ) { int upperLeftX = Math.min( getX1(), getX2() ); int upperLeftY = Math.min( getY1(), getY2() ); int width = Math.abs( getX1() - getX2() ); int height = Math.abs( getY1() - getY2() ); g.setColor( getColor() ); g.fillOval( upperLeftX, upperLeftY, width, height ); } // end method draw }// end class MyOval