Question: package graphics; import java.awt. * ; import java.awt.event. * ; public class DrawShapes extends Frame { public void paint ( Graphics g ) { /
package graphics;
import java.awt.;
import java.awt.event.;
public class DrawShapes extends Frame
public void paintGraphics g creates the content of the frame
GraphicsD ga GraphicsD g;
gasetPaintColorRED;
gadrawOval;
gasetColorColorBLUE;
gafillOval;
gasetPaintColorGREEN;
gadrawRect;
gasetColorColorYELLOW;
gafillRect;
gasetColorColorMAGENTA;
gasetStrokenew BasicStroke;
gadrawLine;
public static void mainString args
DrawShapes frame new DrawShapes; frame is the new object
frame.addWindowListenernew WindowAdapter to receive window events
public void windowClosingWindowEvent we when window is closed
System.exit;
;
frame.setSize; sets size
frame.setVisibletrue; makes it visible
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
