jQuery in Action, 2nd edition*
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
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: 10376
    
    8

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
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

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


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: drawing circle with label inside