Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Drawing Shapes The following is a simple applet that draws a blue rectangle on a yellow background. Shapes.java The program will draw two filled rectangles

image text in transcribed
image text in transcribed
Drawing Shapes The following is a simple applet that draws a blue rectangle on a yellow background. Shapes.java The program will draw two filled rectangles and a filled oval import javax.swing. JApplet import java.awt.* public class Shapes extends JApplet public void paint (Graphics page) / Declare size constants final int MAX SIZE300 final int PAGE WIDTH 600 final int PAGE HEIGHT 400 / Declare variables int ?, ?; // x and y coordinates of upper left-corner of each shape int width, height; I width and height of each shape // Set the background color setBackground (Color.yellow): // Set the color for the next shape to be drawn page.setColor (Color.blue) / Assign the corner point and width and height x200; ?= 150; width 100; height 70; Draw the rectangle page.fillRect (x, y, width, height)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

What are Fatty acids?

Answered: 1 week ago

Question

What are Electrophoresis?

Answered: 1 week ago

Question

=+7 How has the COVID-19 pandemic impacted the operations of IHRM?

Answered: 1 week ago