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

at least one variable name makes trouble

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-6
    • 1.0-RC-1
    • None
    • None
    • Groovy Version: 1.0-JSR-06 JVM: 1.5.0_04-b05 Windows XP Pro

    Description

      While the commented code works (if uncommented), the not commented code does not. The only difference is the name of the comboBox variable "box" or "comboBox". If it is "box", it works, if it is "comboBox", it doesn't.

      /import groovy.swing.
      import javax.swing.DefaultComboBoxModel

      def swing = new SwingBuilder()
      def frame = swing.frame(title:'Test') {
      panel {
      def comboBox = comboBox(items:['Tralala'])
      passwordField(columns:10, actionPerformed:

      { event -> def text = event.source.text println text comboBox.model.insertElementAt(text, 0) comboBox.model.setSelectedItem(text) }

      )
      }
      }
      frame.pack()
      frame.show()*/

      import groovy.swing.*
      import javax.swing.DefaultComboBoxModel

      def swing = new SwingBuilder()
      def frame = swing.frame(title:'Test') {
      panel {
      def box = comboBox(items:['Tralala'])
      passwordField(columns:10, actionPerformed:

      { event -> def text = event.source.text println text box.model.insertElementAt(text, 0) box.model.setSelectedItem(text) }

      )
      }
      }
      frame.pack()
      frame.show()

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            berndschiffer Bernd Schiffer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: