jython07.py
import os
import java.lang from java.awt import Frame,Button,TextArea from java.awt.event import ActionEvent class jython07(java.awt.Frame): def __init__(self): self.size=(208,276) myFile = open("D:\\jython\\jython07.py",'r') myText = myFile.read() myFile.close() self.myOutput=java.awt.TextArea(myText) self.theButton=java.awt.Button("Exit",actionPerformed=self.doExit) self.add("Center",self.myOutput) self.add("South",self.theButton) self.setVisible(1) def doExit(self,event): java.lang.System.exit(0) if __name__=="__main__": myApp=jython07() |
|