java - JRadioButton in Graphic2D -
i want draw radiobuttons panel in graphic2d don't know how can this.
@override public void draw(graphics2d g2) { // ... here draw recntangle2d objects.... }
and here simple jbuttonpanel radio buttons:
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; }
but don't know how can draw in upper method on top below buttonpanel draw recntagles text field.
you don't draw radio buttons. add radio buttons (like other swing component) panel , panel paint buttons you.
read section swing tutorial on how use radio buttons more information , working examples.
Comments
Post a Comment