jython03.py
import java.lang
from java.awt import Frame,Label,Button,GridLayout from java.awt.event import ActionEvent class jython03(java.awt.Frame): def __init__(self): self.size=(208,276) self.theLabel=java.awt.Label("Hello",java.awt.Label.CENTER) self.aButton=java.awt.Button("Exit A",actionPerformed=self.doExit) self.bButton=java.awt.Button("Exit B",actionPerformed=self.doExit) self.cButton=java.awt.Button("Exit C",actionPerformed=self.doExit) self.setLayout(java.awt.GridLayout(4,1)) self.add(self.theLabel) self.add(self.aButton) self.add(self.bButton) self.add(self.cButton) self.setVisible(1) def doExit(self,event): java.lang.System.exit(0) if __name__=="__main__": a=jython03() |
|
|