This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum 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
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "drawing circle with label inside" Watch "drawing circle with label inside" New topic
Author

drawing circle with label inside

Fano Hery
Greenhorn

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: 8562

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


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

Joined: Oct 27, 2005
Posts: 19232

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


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: drawing circle with label inside
 
Similar Threads
Applet Draw shape
Circle Areas
WA #1.....word association
WA #2 ..... word association
JLabels and setText()