Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3642

Add synthetic binding support for JSpinner.value

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.3
    • 1.6.4, 1.7-beta-1
    • Swing
    • None

    Description

      JSlider supports synthetic binding for the value property, JSpinner should get a similar treatment. This should work (but doesn't in 1.6.3)

      import groovy.swing.SwingBuilder
      import groovy.beans.Bindable
       
      @Bindable class Model {
        int intField
      }
       
      sb = new SwingBuilder()
      model = new Model()
       
      sb.frame(pack:true, show:true, defaultCloseOperation:javax.swing.JFrame.DISPOSE_ON_CLOSE) {
        vbox {
          hbox {
            label('Source Spinner:')
            spinner(value: bind(target:model, 'intField', value:50))
          }
          hbox {
            label('Target Spinner:')
            spinner(value: bind(source:model, 'intField'))
          }
        }
      }

      Attachments

        Activity

          People

            shemnon Daniel Ferrin
            shemnon Daniel Ferrin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: