>>> Let's run Python on Mobile

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

jython02.py

import java.lang
from java.awt import Frame,Label,Button,BorderLayout
from java.awt.event import ActionEvent
class jython02(java.awt.Frame):
def __init__(self):
self.size=(208,276)
self.theLabel=java.awt.Label("Hello",java.awt.Label.CENTER)
self.nButton=java.awt.Button("North Exit",actionPerformed=self.doExit)
self.eButton=java.awt.Button("East Exit",actionPerformed=self.doExit)
self.wButton=java.awt.Button("West Exit",actionPerformed=self.doExit)
self.sButton=java.awt.Button("South Exit",actionPerformed=self.doExit)
self.setLayout(java.awt.BorderLayout())
self.add("Center",self.theLabel)
self.add("North",self.nButton)
self.add("East",self.eButton)
self.add("West",self.wButton)
self.add("South",self.sButton)
self.setVisible(1)
def doExit(self,event):
java.lang.System.exit(0)
if __name__=="__main__":
a=jython02()


Jython on PC


Jython on UIQ