• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make circle?

 
Rohit Ramnath
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i need to make a circle when i click a button. how can i do that using applet?
 
yunuss khan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

try this...

import java.awt*;

import java applet Applet;


Public class Circle extends Applet

{

Public void paint (Graphics g)


{


g.setColor (Color.red); // sets color red


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


} // method paint


} // class circe

Regards,
yunus
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... but where's the button?
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are interested in graphics, take the tutorial:
http://java.sun.com/docs/books/tutorial/2d/index.html
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I'll move this to our GUI forum where all things graphics are discussed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic