|
Groovy example source code file (Groovy303_Bug.groovy)
The Groovy Groovy303_Bug.groovy source codepackage groovy.bugs import java.awt.* import java.awt.event.* import javax.swing.* /** * @author Bing Ran * @author Andy Dwelly * @version $Revision: 13693 $ */ class Groovy303_Bug extends GroovySwingTestCase { void testBug() { testInEDT { def scholastic = new Scholastic() scholastic.createUI() } } } class Scholastic implements ActionListener { void createUI() { println('createUI called') def frame = new JFrame("Hello World") def contents = frame.getContentPane() def pane = new JPanel() pane.setLayout(new BorderLayout()) def button = new JButton("A button") button.addActionListener(this) pane.add(button, BorderLayout.CENTER) contents.add(pane) frame.setSize(100, 100) //frame.setVisible(true) button.doClick() } public void actionPerformed(ActionEvent event) { println "hello" } } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy Groovy303_Bug.groovy source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.