Recently I've been looking at Povray, pyprocessing, and cfdg (version 3.0) as tools for creating digital images. I have branched two separate blogs where I mainly explore jruby + processing and processing.py

Thursday, 6 November 2008

My First Ever Netbeans Template

I am a little amazed my template experiment produced a working netbeans template! This is the code it produced. Now I'm even more impressed with the netbeans ide.
   1:import processing.core.PApplet;
2:
3:public class ProcessingApplet extends PApplet{
4:
5: /**
6: * Overrides the processing.core.PApplet.setup()
7: */
8: @Override
9: public void setup() {
10: size(200,200);
11: background(03366);
12: }
13:
14: /**
15: * Overrides the processing.core.PApplet.draw()
16: */
17:
18: @Override
19: public void draw() {
20: }
21:
22:
23: /**
24: * Is the main method required in netbeans
25: * @param args
26: */
27: public static void main(String[] args) {
28: PApplet.main(new String[]{"ProcessingApplet"});
29: }
30:
31:}

Update as of 30 December 2008
Strictly speaking you do not need the main method you could just run the file (or SHIFT-F6 to run in the applet viewer), however it is nice to do it this way as you can explicitly see any args passed without needing to view the project properties.

No comments:

Post a Comment

Followers

Blog Archive

About Me

My photo
Pembrokeshire, United Kingdom
I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2