Some common problems that could cause your program not to work on the web are:
circle()
, square()
,clear()
, delay()
, push()
, pop()
or other functions that aren’t implemented in processing.jsSystem.out.println()
or System.out.print()
in your finished programCHORD
or PIE
modes with arc()
background()
ArrayList
declaration or initialization (e.g. ArrayList<Integer>someList
instead of ArrayList <Integer> someList
)ArrayList
function removeAll()
.pde
file doesn’t match the name in the canvas id tag in index.html
.pde
files you will need to list them in index.html
using a canvas tag like <canvas id="AsteroidsGame" data-processing-sources="Asteroid.pde AsteroidsGame.pde Floater.pde Spaceship.pde Star.pde"> </canvas>
To display our AP Java programs on the web, we’re using processing.js. Not all Processing functions are compatible with processing.js. You can check this list to see if you are using a function that isn’t supported.
Looking for error messages can also provide clues to the problem. You can find the error messages for your webpage by opening the web console or javascript console in your browser. To open the console in Chrome, press the F12 key. To open the console in Firefox, use Ctrl + Shift + J.