>>> Let's run Python on Mobile

วันจันทร์, มกราคม 22, 2550

jython05.py

import java.lang
from java.awt import Frame,MenuBar,Menu,MenuItem,TextArea
from java.awt.event import ActionEvent
class jython05(java.awt.Frame):
def __init__(self):
self.size=(208,276)
self.myOutput=java.awt.TextArea("Hello UIQ from Jython!!!")
self.add("Center",self.myOutput)
self.myMenuBar=java.awt.MenuBar()
self.myMenu=java.awt.Menu("Menu")
self.myMenuExit=java.awt.MenuItem("Exit",actionPerformed=self.doExit)
self.myMenuBar.add(self.myMenu)
self.myMenu.add(self.myMenuExit)
self.setMenuBar(self.myMenuBar)
self.setVisible(1)
def doExit(self,event):
java.lang.System.exit(0)
if __name__=="__main__":
myApp=jython05()


Jython on PC


Jython on UIQ