This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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: 10486

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.

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

Joined: Oct 27, 2005
Posts: 19723

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

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: drawing circle with label inside