zoukankan      html  css  js  c++  java
  • Processing in Eclipse

    This article is the summary of http://processing.org/learning/eclipse/

    0. Environment

    Windows XP sp3

    1.Steps

    1.1 Install Java(JDK)

    1.2 Install Processing

    1.3 Download and install Eclipse

    1.4 Create a new Java project

    FILE --> NEW PROJECT and select "Java Project." Click next. Enter your project name (for example, "TestProcessing") and select "Finish."

    1.5 Import the Processing libraries

    FILE --> IMPORT --> GENERAL --> FILE SYSTEM
    --> browse and find the Processing application, look inside the directory called "lib" --> Select the file "core.jar" --> FINISH
    --> Right-click on the file and select --> BUILD PATH --> ADD TO BUILD PATH

    1.6 Create a class and write your code

    Create a class "MyProcessingSketch"
    ////////////////////////////////////////////////////////////
    import processing.core.*;
    public class MyProcessingSketch extends PApplet
    {
      public void setup()
      {
        size(200,200);
        background(0);
      }
      public void draw()
      {
        stroke(255);
        if (mousePressed)
        {
          line(mouseX,mouseY,pmouseX,pmouseY);
        }
      }
    }

    ////////////////////////////////////////////////////////////

    1.7 Run as Java Application

    ////////////////////////////////////////////////////////////

      public static void main(String args[])
      {
        PApplet.main(new String[] { "--present", "MyProcessingSketch" });
      }

    ////////////////////////////////////////////////////////////

    Note that the String "MyProcessingSketch" must match the name of your class (and if it is in a package, should include the package, i.e. packagename.MyProcessingSketch).

    2. Reference

    http://processing.org/learning/eclipse/

  • 相关阅读:
    goreplay~基本知识
    goreplay~http输出队列
    goreplay~拦截器设置
    goreplay~流量变速
    goreplay~http过滤参数
    goreplay~文件输出解析
    goreplay~http输出工作线程
    Antlr4 语法解析器(下)
    2021最新版Eclipse的下载和使用
    MySQL中drop、truncate和delete的区别
  • 原文地址:https://www.cnblogs.com/chenyineng/p/2669768.html
Copyright © 2011-2022 走看看