|
Groovy example source code file (Groovy303_Bug.groovy)
The Groovy Groovy303_Bug.groovy source code
package 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: |
Other websites by Alvin Alexander:
Life/living in Alaska (OneMansAlaska.com)
How I Sold My Business (HowISoldMyBusiness.com)
Copyright 1998-2011 Alvin Alexander, devdaily.com
All Rights Reserved.