title: ImageJ: Get specific Radiobox
body: <p>I'm working on a Plugin for compressing images. Before the "magic happens" the user should decide, if he wants use a method with three or four neighbors. 
  For this, I created a generic Dialog with a RadioButtonGroup. </p>
  
  <p>This works fine, my question is how do I get the choice of the user? The Method getRadioButton gives a Vector back. But I don’t know how to handle this. My plan was to use the Index of the Button which was choose as a parameter for my main class, but I don’t see a way to manage this.</p>
  
  <p>Have you any idea?</p>
  
  <p>Edit: My Code (without import)</p>
  
  <pre><code>public class FrameDemo_ extends PlugInFrame {
      public FrameDemo_ (){
          super("FrameDemo");
      }
  
      public void run (String arg){
          String[] items = {"Option A", "Option B"};
          GenericDialog gd = new GenericDialog("FrameDemo settings");
          gd.addRadioButtonGroup("Test",items,2,1,"0");
          gd.showDialog();
          if (gd.wasCanceled()){
              IJ.error("PlugIn canceled!");
              return;
          }
          String input;
          Vector vec = gd.getRadioButtonGroups();
          Object obj = vec.elementAt(0);
          input = obj.toString();
  
          this.setSize(250, 250);
          this.add(new Label(input, Label.CENTER));
          this.setVisible(true);
      }
  }
  </code></pre>
  
  <p>My Target is to do something like:</p>
  
  <pre><code>input = obj.Somefunction; // Input contains for exampe "A" for Option A
  
  class RealPlugin (parameter input){
      if(input == A) { do something } // Pseudocode...not the real if for a string 
  
  else if {input == B) {do something else }
  </code></pre>
  
  <p>My Problem is, when I convert the Object to String it is:</p>
  
  <p>java.awt.CheckboxGroup[selectedCheckbox=java.awt.Checkbox[checkbox0,0,0,66x23,invalid,label=Option A,state=true}}</p>
  
  <p>I'm sure there is a way for String manipulation, but I don't think this is the proper way to do this. I mean this must be a so typical job (use a radiobuttongroup to get a user choice) that there must be a clever way or a function...</p>