Export. Processing programs
	can be exported to run on the web as Java Applets and can be exported as applications to run on Windows,
	Linux, and Mac OS X.

Applet Export
Application Export
Applet Security Restrictions
"Present" Features

Top Applet Export

The export feature packages a sketch to run within a Web browser. When code is exported from Processing it is converted into Java code and then compiled as a Java Applet. When a project is exported, a series of files are written to a folder named "applet" that is created within the sketch folder. All files from the sketch folder are exported into a single JAR file with the same name as the sketch. For example, if the sketch is named "Sketch_123", the exported file will be called "Sketch_123.jar".

The applet folder contains the following:

Every time a sketch is exported, the contents of the "applet" folder are deleted and the files are written from scratch. Any changes previously made to the "index.html" file are lost. To customize the HTML that's included when an applet is exported, copy the applet.html file from Processing → lib → export to the root of your sketch folder.

Media files not needed for the applet should be deleted from the data folder before exporting to keep the file size small. For example, if there are unused images in the "data" folder, they will be added to the JAR file, thus needlessly increasing its size.

When exporting an applet, a description can be included on the default HTML page that's created. Processing will include everything from the first instance of /** to a closing */ as a javadoc comment. So you can add this to your sketch:

  /**
   * You can't rock Processing like I can rock Processing.
   */
and that text would automatically be embedded in the exported html page. Like a javadoc comment, the text can (and should) be any valid html since it will be embedded directly in the page. Asterisks at the left of each line will be removed.

Top Application Export

In addition to exporting Java Applets for the Web, Processing can also export Java Applications for the Linux, Macintosh, and Windows platforms (as of release 0097). When "Export Application" is selected from the "File" menu, folders will be created for each of the operating systems specified in the Preferences. Each folder contains the application, the source code for the sketch, and all required libraries for a specific platform.

Making applications can be trickier than applets. Some hints and notes follow below. If you find problems, file a bug.

Top Applet Security Restrictions

Applets running inside a web browser have several security restrictions, in order to protect web users. For instance, an applet cannot read files from the local disk or connect to servers other than the server from which it came. To avoid these restrictions, it's possible to "sign" an applet. In a signed applet, a dialog box will appear to ask the user whether they trust you as the provider of the applet, and if it's ok for the applet to perform actions that might be a security risk. More information can be found in Sun's documentation.

Top "Present" Features