|
From: Rafael B. <be...@hs...> - 2016-02-17 18:25:47
|
Hello,
The demo program below used to work, but now, when the button is clicked, nothing happens, although the window displaying the button does open just fine. I run it in the Macintosh Unix terminal. Any assistance with this problem would be greatly appreciated.
Rafael Bejarano
from javax.swing import JButton, JFrame
frame = JFrame('Hello, Jython!', defaultCloseOperation = JFrame.EXIT_ON_CLOSE, size = (300,300))
def change_text(event):
print "Clicked!"
button = JButton('Click Me!', actionPerformed=change_text)
frame.add(button)
frame.visible = True
|