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

Problem with access to instance methods from closures in SwingBuilder

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-JSR-6
    • syntax
    • None

    Description

      An instance method is not found from inner node of SwingBuilder:

      class StaticTest {
      static void main(args)

      { new StaticTest() }

      public StaticTest () {
      def swing = new groovy.swing.SwingBuilder()
      def myFrame = swing.frame(size:[100,50]) {
      panel() {
      button(text: "test", actionPerformed:

      { testMethod() }

      )
      }
      }
      myFrame.visible = true
      }

      private testMethod()

      { println "test" }

      }

      It gets visible if we:
      1) remove panel(), and just place button in the form without panel
      2) create a property in the class, assign 'this' to this property, and access the method via the property.

      Attachments

        Activity

          People

            tug John Wilson
            lipinski Pawel Lipinski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: