LinesRectsOvals.java



//LinesRectsOvals.java

import java.awt.*;
import javax.swing.*;

public class DrawArcs extends JFrame
{

//
public DrawArcs()
{
super(" DrawArcs ");
setSize( 400, 200 );
setVisible( true );
}

public void paint( Graphics g )
{
super.paint( g );

g.setColor( Color.YELLOW );
g.drawRect( 15, 35, 80, 80 );
g.setColor( Color.BLACK );
g.drawArc( 15, 35, 80, 80, 0, 360 );

g.setColor( Color.YELLOW );
g.drawRect( 100, 35, 80, 80 );
g.setColor( Color.BLACK );
g.drawArc( 100, 35, 80, 80, 0, 110 );

g.setColor( Color.YELLOW );
g.drawRect( 185, 35, 80, 80 );
g.setColor( Color.BLACK );
g.drawArc( 185, 35, 80, 80, 0, -270 );

g.fillArc( 15, 120, 80, 40, 0, 360 );

g.fillArc( 100, 120, 80, 40, 270, -90 );

g.fillArc( 185, 120, 80, 40, 0, -270 );

}

public static void main( String arg[] )
{
DrawArcs application = new DrawArcs ();
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
}
}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s