[110918]: htdocs / applets / index.ht Maximize Restore History

Download this file

index.ht    72 lines (59 with data), 2.2 kB

Title: Easy Applets with Jython

<H3>Jython Applet Demos</H3>

	<B>Note: You must be running a <A HREF="problems.html">JDK 1.1 compliant web browser</A> to view the applets on
	this page.</B>

<APPLET Code="JythonLoader" WIDTH="220" HEIGHT="90" ALIGN="BOTTOM">
Wait until the Jython library has completely loaded before continuing.
This library is about 200K and should take around 1 minute to download 
over a 28.8 modem. You should expect considerably faster download times
if you have a better network connection.
<em>Here is the <a href="JythonLoader.java">Java source</a> code for the 
Jython loading display you see above.</em>

<P>Once the library has loaded, your first Jython applet will appear below:
<APPLET ARCHIVE="appletdemo.jar" CODE="HelloWorld" WIDTH="160" HEIGHT="50" ALIGN="BOTTOM" alt="This browser doesn't support JDK 1.1 applets.">
<PARAM NAME="cabbase0" VALUE="appletdemo.cab">
<H3>Something has gone wrong loading this applet.</H3>
If you don't see the text &quot;Hello from Jython!&quot; above, 
then something has gone wrong.
See <A HREF="problems.html">what to do when Jython applets don't work</A> 
for suggestions on how to fix the problem.

<P>The complete source code for this applet is displayed below: <BR>

from java.applet import Applet

class HelloWorld(Applet):
    def paint(self, g):
        g.drawString(&quot;Hello from Jython!&quot; 20, 30)

<H3>More Examples of Jython Applets</H3>

Examples based on <A HREF="http://java.sun.com/docs/books/tutorial">The Java Tutorial</A> Examples

	<LI>Using the basic AWT GUI elements
		<LI><A HREF="button.html">ButtonDemo</A>
		<LI><A HREF="checkbox.html">CheckboxDemo</A>
		<LI><A HREF="choice.html">ChoiceDemo</A>
		<LI><A HREF="label.html">LabelDemo</A>
		<LI><A HREF="list.html">ListDemo</A>
	<LI>Low-level drawing
		<LI><A HREF="coordinates.html">CoordinatesDemo</A>
	<LI>Putting it all together
		<LI><A HREF="converter.html">Converter</A> - a simple metric to english conversion applet