Computers and Technology

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);
}
}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:20, Aleja9
It policy compliance and emerging technologies respond to the following: propose at least three control measures that organizations need to put in place to ensure that they remain complaint with emerging technologies and in a continually changing it environment. examine the correlation of effective configuration management and change control procedures to remain compliant with emerging technologies and it security changes.
Answers: 2
image
Computers and Technology, 23.06.2019 16:00, cravens511peeelg
An english teacher would like to divide 8 boys and 10 girls into groups, each with the same combination of boys and girls and nobody left out. what is the greatest number of groups that can be formed?
Answers: 2
image
Computers and Technology, 23.06.2019 20:40, bobby3350
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?
Answers: 2
image
Computers and Technology, 23.06.2019 22:30, keel5468
You draw two cards from a standard deck of 52 cards, but before you draw the second card, you put the first one back and reshuffle the deck. (a) are the outcomes on the two cards independent? why?
Answers: 3
Do you know the correct answer?
Write a method that draws a circle and a square that is centered in a DrawingPanel. The method will...

Questions in other subjects:

Konu
Mathematics, 24.08.2019 12:50
Konu
Mathematics, 24.08.2019 12:50