示例#1
0
文件: test185a.py 项目: certik/jython
from java.awt import Frame
from java.applet import Applet
from test185m import *

class test185a(Applet):
        def __init__(self):
                self.mydd = dd()
                self.add(self.mydd)


class foo:
	pass

class bar(foo):
	pass

if __name__ == "__main__":
        f = Frame(); c = c()
        f.add(c); f.pack(); f.show()

示例#2
0
from java.awt import Frame
from java.applet import Applet
from test185m import *


class test185a(Applet):
    def __init__(self):
        self.mydd = dd()
        self.add(self.mydd)


class foo:
    pass


class bar(foo):
    pass


if __name__ == "__main__":
    f = Frame()
    c = c()
    f.add(c)
    f.pack()
    f.show()
#


class TestButtonAction(ActionListener):
    def actionPerformed(self, e):
        textArea.append("Test Button Clicked!\n")


#
# Create the Frame, Panel, Button,
# TextArea, and TestButtonAction objects.
#

frame = Frame("Hello World")
panel = Panel()
button = Button("Test Button")
buttonAction = TestButtonAction()
textArea = TextArea()

#
# Put everything together and show
# the window.
#

button.addActionListener(buttonAction)
panel.add(button)
panel.add(textArea)
frame.add(panel)
frame.pack()
frame.show()

class TestButtonAction(ActionListener):
    def actionPerformed(self, e):
        textArea.append("Test Button Clicked!\n")


#
# Create the Frame, Panel, Button,
# TextArea, and TestButtonAction objects.
#

frame = Frame("Hello World")
panel = Panel()
button = Button("Test Button")
buttonAction = TestButtonAction()
textArea = TextArea()


#
# Put everything together and show
# the window.
#

button.addActionListener(buttonAction)
panel.add(button)
panel.add(textArea)
frame.add(panel)
frame.pack()
frame.show()