JRadioButton in Graphic2D
<p>I want to draw radiobuttons panel in Graphic2D but I don't know how can I do this.</p>

<pre><code>@Override
    public void draw(Graphics2D g2)
    {
      // ... Here I draw some Recntangle2D objects....

    }
</code></pre>

<p>And here is simple jbuttonpanel with radio buttons:</p>

<pre><code> public ButtonGroup buttons() {
        JRadioButton button1 = new JRadioButton("Red");
        JRadioButton button2 = new JRadioButton("Green");
        JRadioButton button3 = new JRadioButton("Blue");
        ButtonGroup colorButtonGroup = new ButtonGroup();
        colorButtonGroup.add(button1);
        colorButtonGroup.add(button2);
        colorButtonGroup.add(button3);
        button1.setSelected(true);
        return colorButtonGroup;
    }
</code></pre>

<p>But I don't know how can I draw it in upper method on top where below my buttonpanel I draw some recntagles with text field.</p>