We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I mean in a normaal java class you would like code
class Whatever {
public Whatever() {}
}
but now where there is just the void setup() and draw() I do not exactly know how/where to add a cunstructor to the first class. So... could anybody tell me what to do?
Answers
@GoToLoop well actually I feel a little dumb. I already tried to make a constructor with the file's name but I directly wanted to implement something like a ComponentListener and that did not work and idk. Thx
see tutorial objects:
https://www.processing.org/tutorials/objects/
Example:
here is a nice example by TfGuy
@Chrisir may I ask why exactly there are no modifiers like private or public at all? I mean in normal Java this would be considered as dirty coding...
private
access level can't prohibit anything from accessing each other within it. >-)(if you export a project and dig around in the created directories you can find the java file it creates)