Files
dev/plugins/sb1.groovy
2018-01-19 10:56:53 +01:00

14 lines
545 B
Groovy
Executable File

import groovy.swing.SwingBuilder
import java.awt.BorderLayout as BL
count = 0
new SwingBuilder().edt {
frame(title: 'Frame', size: [300, 300], show: true) {
borderLayout()
textlabel = label(text: 'Click the button!', constraints: BL.NORTH)
button(text:'Click Me',
actionPerformed: {count++; textlabel.text = "Clicked ${count} time(s)."; println "clicked"}, constraints:BL.SOUTH)
button(text:'Run',
actionPerformed: { Thread.start {controller.evalLine(":run test1")}}, constraints:BL.SOUTH)
}
}