All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Demo.awt.simple.py Maven / Gradle / Ivy

Go to download

Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform.

There is a newer version: 2.7.4
Show newest version
"""\
This is a very simple example of using Java's AWT from JPython.

Many more examples can be found in Demo/applet.  While all of those
demos are designed as applets, they can also be run as applications
and they all show how to use different parts of the AWT.
"""

import java
from java import awt


def exit(e): java.lang.System.exit(0)


frame = awt.Frame('AWT Example', visible=1)
button = awt.Button('Close Me!', actionPerformed=exit)
frame.add(button, 'Center')
frame.pack()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy