# Define the TestButtonAction class. TestButtonAction # inherits from the Java ActionListener interface. # 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()
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()