subject

Write a method that draws a circle and a square that is centered in a DrawingPanel. The method will take in the width and height (they are the same for both the circle and square) and a Graphics object as parameters IN java
current code: turn it into a method along with the main method
import java. awt.*;
public class Graphics {
static final int WIDTH = 300;
static final int HEIGHT = 200;
public static void drawGraphics () {
}
public static void main(String []args) {
DrawingPanel2 draw = new DrawingPanel2(WIDTH, HEIGHT); // Make a DrawginPanel2 of size 300 by 200.
Graphics2D g = draw. getGraphics(); // gets graphics from DrawingPanel so you can draw
g. setColor(Color. RED);
g. fillRect(45, 30, 200, 150);
g. setColor(Color. BLUE);
g. fillOval(70, 30, 150, 150);
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:30
How can you repin an image on your pinterest pin board a. click on the "repin" button b. click on the "add pin" button c. click on the "upload a pin" button d. click on the "save pin" button.
Answers: 2
question
Computers and Technology, 23.06.2019 11:50
While preforming before operation pmcs, you notice the front right tire appears slightly under-inflated. what is the proper action?
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
Idon’t understand the double8 coding problem. it is java
Answers: 1
question
Computers and Technology, 23.06.2019 22:50
An environmental protection agency study of 12 automobiles revealed a correlation of 0.47 between engine size and emissions. at 0.01 significance level, can we conclude that there is a positive association between the variables? what is the p value? interpret.
Answers: 2
You know the right answer?
Write a method that draws a circle and a square that is centered in a DrawingPanel. The method will...
Questions
question
Mathematics, 23.08.2021 19:40
question
Mathematics, 23.08.2021 19:40
Questions on the website: 13722361