File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes How to make circle? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to make circle?" Watch "How to make circle?" New topic

How to make circle?

Rohit Ramnath

Joined: May 08, 2006
Posts: 6
i need to make a circle when i click a button. how can i do that using applet?
yunuss khan

Joined: Apr 22, 2006
Posts: 17

try this...

import java.awt*;

import java applet Applet;

Public class Circle extends Applet


Public void paint (Graphics g)


g.setColor (; // sets color red

g.fillOval (100,100,50,50); //Draws circle with loacation 100,100, and diam 50

} // method paint

} // class circe

Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
... but where's the button?

There is no emoticon for what I am feeling!
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
If you are interested in graphics, take the tutorial:
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

I think I'll move this to our GUI forum where all things graphics are discussed.

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: How to make circle?
It's not a secret anymore!