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 & HelpSyntax Questions › Processing to Java mode
Page Index Toggle Pages: 1
Processing to Java mode (Read 464 times)
Processing to Java mode
Jul 2nd, 2007, 4:39am
 
I want to convert my Processing program to the full Java mode.
In the documentation, this example is given:

public class MyDemo extends PApplet {

 void setup() {
   size(200, 200);
   rectMode(CENTER);
   noStroke();
   fill(0, 102, 153, 204);
 }

 void draw() {
   background(255);
   rect(width-mouseX, height-mouseY, 50, 50);
   rect(mouseX, mouseY, 50, 50);
 }

}

When I try this it on my working program, it is no longer working, cause it can no longer find my other classes.

Should there not be a
public static void main(String[] args) {} ?

Where should setup() and draw() go?
Inside main or outside?

Is the extends PApplet necessary? sufficient?

What about my other classes in my other tabs?

Page Index Toggle Pages: 1