Ask coding questions

← Back to all posts
How do I access (Java) functions inside a Class?
MichaelOliva (0)

I teach AP CS-A, and want to start using Processing with my students, but many only have access to online tools, so we use exclusively.

I just came across the Processing template (, which allowed me animate a simple Asteroids ship. But when I tried to create a class (Floater) to do this, I got an error indicating the Processing functions I was using are not accessible (i.e. stoke() and line() ). This works in Processing, but not in this template.

I tried Sketch.line() but that didn't work.

Any thoughts or work arounds?

Coder100 (17011)

This is the Java environment, not the processing Java environment.

That is different. That environment is an 'adaptation' of the Java programming language, but less featured and built for the web and graphics in mind.

MichaelOliva (0)

Thanks for the reply, but I'm not sure I understand what you mean. By 'this' do you mean Replit? Or processing.core.PApplet?

Coder100 (17011)

by this, specifically i meant your repl language @MichaelOliva