For Drawing a circle in Swing:
public class CirclePanel extends JPanel {
@Override
protected void paintComponent(Graphics g) {
//Adding super.paintComponent....
super.paintComponent(g);
g.drawOval(0, 0, g.getClipBounds().width, g.getClipBounds().height);
}
}
For adding text inside the circle you can use GridBagLayout.i.e.
CirclePanel panel = new CirclePanel();
panel.setLayout(new GridBagLayout());
GridBagConstraints cl;
cl = new GridBagConstraints();
cl.gridy = 0;
panel.add(new JLabel("Hello"), cl);
Here is the Link in that you can use swing to draw a circle using Canvas.