0

Is it possible to bind to a map element ?

mybean = new MyBean()
swing.edt {
  dialog() {
    vbox(){
      label(text: '> Please enter your developer account')
      def tf = textField(columns:10)
      bean mybean, myMap.myKey: bind {tf.text}
      button(defaultButton: true, text: 'OK', actionPerformed: {dispose() },
        enabled: bind {new File(userBean.myMap.myKey).exists()})
    }
  }
}

with

@Bindable
class MyBean {
Map<String,String> myMap
}

OR maybe I do this the wrong way. I want to enable the OK button only if the stuff entered in the text field is valid. I want to store the content of the text field in a specific key of the myMap map from the myBean bean, and then check the file existence

facewindu
  • 705
  • 3
  • 11
  • 31

0 Answers0