We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Processing and Eclipse RCP
Page Index Toggle Pages: 1
Processing and Eclipse RCP (Read 808 times)
Processing and Eclipse RCP
Nov 18th, 2009, 8:46am
 
Hi everybody,

i'm trying to use Processing in an existing RCP application but i'm having no luck initiating the PApplet.

There is following Exception thrown:
java.lang.RuntimeException: You need to use "Import Library" to add processing.core.PGraphicsJava2D to your sketch.
     at processing.core.PApplet.makeGraphics(PApplet.java:1192)
     at processing.core.PApplet.init(PApplet.java:594)

I tried including the core.jar bundled as a RCP-Plugin instead of including it on the classpath, but that didn't helped at all.

I called my custom PApplet as following, which is working in a standalone swt-application:
Code:

Composite composite = new Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
composite.setLayoutData(gd);
composite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
Frame frame = SWT_AWT.new_Frame(composite);
MyPApplet pap = new MyPApplet();
frame.add(pap);
pap.init();


Here is the MyPApplet class:
Code:

import processing.core.PApplet;

public class MyPApplet extends PApplet {

int x =230;
int y =185;

public void setup(){
size(300,300);

}
}


It would be grate if anybody has any suggestions
Page Index Toggle Pages: 1