wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes drawing circle with label inside Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "drawing circle with label inside" Watch "drawing circle with label inside" New topic

drawing circle with label inside

Fano Hery

Joined: Jul 13, 2010
Posts: 2
i want to draw filled circle with label inside it for example "A" inside the circle. Anyone can help me?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10175

Welcome to the Ranch.

What have you got so far, and where are you stuck?
Usually, one would
1) Override the paintComponent method
2) Use the reference to Graphics g and invoke the required method on the "g" instance. e.g. http://faq.javaranch.com/java/BackgroundImageOnJPanel

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Rob Spoor

Joined: Oct 27, 2005
Posts: 19656

You forgot step 1a) call super.paintComponent(g).

How To Ask Questions How To Answer Questions
It is sorta covered in the JavaRanch Style Guide.
subject: drawing circle with label inside
Similar Threads
WA #1.....word association
Circle Areas
Applet Draw shape
WA #2 ..... word association
JLabels and setText()