Swing

Introduction

This howto describes how to setup the Swing example application using Jython 2.5 and newer.

Download

Grab the example from SVN with:

svn export http://svn.pyamf.org/trunk/doc/tutorials/examples/jython jython-example
cd jython-example

Alternatively, if you just want to have a look, you can browse the example online.

Run Application

The Swing application contains a AMF client and server that starts on http://localhost:8000 when you run the gui.py file:

jython gui.py

Use the Start Server button to launch the server and make AMF client calls using the Invoke Method button.

../../_images/swing-example.png

Client

The Python AMF client can be started by running the following from the jython folder:

jython client.py

You should see something like this for the client:

Hello World!

Options

When you run jython client.py –help it will display the various options available for this example client:

Usage: client.py [options]

Options:
  -h, --help            show this help message and exit
  -p PORT, --port=PORT  port number [default: 8000]
  --host=HOST           host address [default: localhost]