Question

Using the Graphics object g, create the following shapes
50, 100 5) Now draw that same circle except use 50,100 as its center point
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Java Program:

import java.awt.*;
import javax.swing.JFrame;
  
public class Circle extends Canvas{
  
public void paint(Graphics g) {
setBackground(Color.WHITE);
g.drawOval(50,100,100,100);
  
}
public static void main(String[] args) {
Circle m=new Circle();
JFrame f=new JFrame();
f.add(m);
f.setSize(400,400);
f.setVisible(true);
}
}

Command Prompt-Java DisplayGraphics C:\UserSA -13522 Desktop java DisplayGraphics C: \Users VA C: \Users\A 13522 Desktop>javac DisplayGraphics.java 13522\Desktop java DisplayGraphics

if you like the answer please provide a thumbs up.

Add a comment
Know the answer?
Add Answer to:
Using the Graphics object g, create the following shapes 50, 100 5) Now draw that same...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Use Python 3 Create a program that uses Turtle to draw shapes. Show the following menu:...

    Use Python 3 Create a program that uses Turtle to draw shapes. Show the following menu: Enter Circle Enter Rectangle Remove Shape Draw Shapes Exit Circles – User inputs position, radius, and color. The position is the CENTER of the circle Rectangles – User inputs position, height, width, color. The position is the lower left-hand corner Colors – Allow red, yellow, blue, and green only Remove – Show the number of items in the list and let the user enter...

  • his assignment will help the student by: Create shapes using Java code Using and creating colors...

    his assignment will help the student by: Create shapes using Java code Using and creating colors with Java Coding JFrames and using the Graphics g method Using Loops (to draw) Your program will generate a drawing using java. You should draw an object that makes sense, not just spare shapes and colors. You must use at least 3 different shapes You must use at least 2 different fonts You must use at least 2 predefined java colors and one custom-made...

  • GUI bouncing shapes program use this interface the out put of the program should be a jFr...

    GUI bouncing shapes program use this interface the out put of the program should be a jFrame with three buttons: “add triangle”, “add square” and “add circle” and a blank screen. when the user clicks any of these buttons the corresponding shape appears and starts bouncing around the screen. the shape of these shaoes and randomized and anytime the user clicks the button you should be able to keeping adding shapes on the screen while the previosus shape is bouncing...

  • Java Painter Class This is the class that will contain main. Main will create a new...

    Java Painter Class This is the class that will contain main. Main will create a new Painter object - and this is the only thing it will do. Most of the work is done in Painter’s constructor. The Painter class should extend JFrame in its constructor.  Recall that you will want to set its size and the default close operation. You will also want to create an overall holder JPanel to add the various components to. It is this JPanel that...

  • create anything in python. Make sure your code covers all of the following things: • Use...

    create anything in python. Make sure your code covers all of the following things: • Use the concepts of object-based programming—classes, objects, and methods • Draw two-dimensional shape • Use the RGB system to create colors in graphics applications and modify pixels in images • Develop recursive algorithms to draw recursive shapes • Write a nested loop to process a two-dimensional grid • Perform simple transformations of images, such as conversion of color to gray-scale

  • Using the IST Linux system create the following Java command line inheritance application Lab4. Create the...

    Using the IST Linux system create the following Java command line inheritance application Lab4. Create the following project Java files: Point.java, Shape.java, Circle.java, Triangle.java, Rectangle.java, and Lab4.java Point.java will contain two coordinates x and y. This will be reused to create point objects to draw all the shapes. Shape.java will be the parent class and will contain a Point type. Circle.java, Triangle.java, Rectangle.java will all be children of Shapes.java class Each class (Circle, Triangle, Rectangle) will contain the private class...

  • 8. Create the following three labeled rectangular buttons using turtle graphics using the write method (eg,...

    8. Create the following three labeled rectangular buttons using turtle graphics using the write method (eg, t.write("Hi!")). Have the distance between the Start and Stop buttons be the same as the space between the Stop and Pause buttons Start Stop Pause

  • Please use JAVA Create an additional drawing panel at least 400 x 400. On it, draw...

    Please use JAVA Create an additional drawing panel at least 400 x 400. On it, draw filled-in shapes of at least two types (rectangles, circles, etc.) in at least two colors. Each shape type should be drawn by its own method (that you write) with parameters indicating where it is to be drawn and how big it is to be. Consider including the color as a parameter as well; this would make the function more flexible. Draw at least ten...

  • Please use JAVA Create an additional drawing panel at least 400 x 400. On it, draw filled-in shap...

    Please use JAVA Create an additional drawing panel at least 400 x 400. On it, draw filled-in shapes of at least two types (rectangles, circles, etc.) in at least two colors. Each shape type should be drawn by its own method (that you write) with parameters indicating where it is to be drawn and how big it is to be. Consider including the color as a parameter as well; this would make the function more flexible. Draw at least ten...

  • Create a Book object using a Java program. This object should contain the following variables bookName,...

    Create a Book object using a Java program. This object should contain the following variables bookName, bookAuthorName, bookGenre. Now create 3 different book objects and store them in an array. Finally iterate through this array and print out the book names.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT