Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started