六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 278|回复: 0

Processing in Eclipse

[复制链接]

升级  41.33%

32

主题

32

主题

32

主题

秀才

Rank: 2

积分
112
 楼主| 发表于 2012-12-30 11:50:30 | 显示全部楼层 |阅读模式
<div id="cnblogs_post_body">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/
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表