0 Replies Latest reply: Mar 7, 2009 10:26 PM by 843807 RSS

    binding to Radio Buttons

    843807
      I'm using the org.jdesktop.beansbinding package (aka JSR 295) with Netbeans with some success. Sometimes the GUI form editor can't handle the binding I want to do so I have to add manual code, but overall it works pretty well.

      What I can't figure out how to do is bind a ButtonGroup of JRadioButton objects. I ended up manually coding a big set of actions to get the job done outside of beansbinding.

      Ideally, I would want to bind to an enum-type property, for example with the bean:
      class SomeBean {
        public enum OptionChoice { Up, Down, Sideways };
        public OptionChoice getOption() { ... }
        public void setOption(OptionChoice value) { ... }
      }
      What createAutoBinding() would allow me to bind three radio buttons that gives the user the choice to the option property? Danged if I can figure out if it is even supported by the current implementation, much less figure out how to code it. I have searched and found other people with the same question but no answers.

      Much thanks for any help.