0
我試圖運行使用的Jython Python腳本,Jython的錯誤 「異常線程 」AWT-EventQueue的-0「」
from javax.swing import JButton,JFrame
def action():
execfile(r"E:\stack.py")
frame = JFrame("window")
button = JButton("button", actionPerformed = action)
frame.add(button)
frame.show()
但它顯示錯誤:
Exception in thread "AWT-EventQueue-0" TypeError: action() takes no arguments (1 given)
在這裏,我沒有任何參數傳遞給動作函數!
我在哪裏出錯?
謝謝