Reference for Processing version 1.5. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.

Name | ### import
Examples |
    import processing.opengl.*;

    void setup() {
      size(screen.width, screen.height, OPENGL);
    }

    void draw() {
      line(0, 0, width, height);
      line(0, height, width, 0);
    }
Description | The keyword import is used to load a library into a Processing sketch. A library is one or more classes that are grouped together to extend the capabilities of Processing. The * character is often used at the end of the import line (see the code example above) to load all of the related classes at once, without having to reference them individually. The import statement will be created for you by selecting a library from the "Import Library..." item in the Sketch menu.
Syntax |
    import libraryName
Parameters |
libraryName | the name of the library to load (e.g. "processing.pdf.*")
Usage | Web & Application

Updated on August 30, 2010 04:29:39pm EDT