Bug 1370 : utterly minimal processing program doesn't work as html applet
Last modified: 2009-11-19 23:38



Assigned To:

Attachment Type Created Size Actions

Description:   Opened: 2009-11-12 21:40
this code works in the processing PDE,
and it works when exported to an 'app' on the mac...

but when exported as an html page with a java applet,
it doesn't draw the correct 'size' window,
nor does the 'background' color (red) appear.
( nor did it display anything else when i had more code happening....
( ... i whittled it down to this...)

note that if i put the 'size' explicitly like so:
size( 600, 600 );
then it works.

but if i take the '600' out,
... and make it an 'int' variable,
then the browser displays a 100x100 black square (the size of the Processing logo...),
and it is not in the background color i specify (red).

so what breaks things,
is if i take the '600' out of 'size',
and make it a separate 'int' variable, as the first line of the program.

my setup:
Processing version number 1.0.7
safari (v 4.0.4 ... current version)
mac osx v 1.5.8
... with current java -- not sure what java that is, or what safari is using to run applets.

? and,
i don't know where to find any "error messages" when looking at an applet in a browser...


here's the code that doesn't work:

note again,
if the '600' is hard-coded into the 'size' line like so:
.... 'size( 600, 600 );'
.... instead of being a variable (( int xys=600; )) ....
then the applet draws the correct 600x600 red square.

************* the code:

int xys = 600; // size of view area

void setup() {
size( xys, xys );

background( 200, 0, 0 );

void draw() {
Additional Comment #1 From REAS 2009-11-19 23:38
It's not a bug, it's how Processing works. This is explained in the second
paragraph of the reference: