[Solved] Java/Processing is that possible ? void hello(void funktion) [closed]

With Java 8 you can use a lambda. With Processing, you can use an anonymous class that implements a functional interface. Something like this: interface DoFunction{ void do(); } void hello(DoFunction function){ function.do(); } void setup(){ hello(new DoFunction(){ void do(){ println(“here”); } }); } 3 solved Java/Processing is that possible ? void hello(void funktion) [closed]

[Solved] Processing – “unexpected token: void” [closed]

You do have a syntax error. The Class keyword should be class with a lower-case c. You should also not have parenthesis after the class name. Also, see my answer here. The Processing editor doesn’t like when you only have a class definition without Processing functions like setup() and draw(). Side note: you might want … Read more

[Solved] size() command not working when containing method is run within a static method [closed]

If you want the size() method to resize your window you need a least to declare one. I suggest you replace void setup(){ size(500,500); } with void setup(){ JFrame myFrame = new JFrame(); myFrame.setSize(500,500); myFrame.setVisible(true); } 2 solved size() command not working when containing method is run within a static method [closed]

[Solved] Need Help! Number Wizard in java?

Please note that the draw() function fires 60 times per second. Even after you call frameRate(1), the draw() function fires once per second. Further note that all of your logic is inside your draw() function. So the guessing will happen on an interval. You’re also not checking whether the key is currently pressed. Note that … Read more

[Solved] Resizeing an Array [closed]

You can probably understand from the other answers that it is not possible to change the size of an array after you create it. When you say int [] A = new int[5]; what you are really saying is that you have an object called ‘A’ and you want to put in there an array … Read more

[Solved] Why is the comma in two text fields put at the same time without focusing?

Why is the comma placed without focusing text fields? Because you are using the global keyPressed() event. This condition: if (e.getKey() == ‘,’) checks that the , key is pressed and it’s redundant to check twice in your case. It’s equivalent to this simpler/cleaner snippet: public void keyPressed(KeyEvent e) { if (key == ‘,’){ X9.setText(X9.getText() … Read more