[Solved] arrayindexoutofbounds exception processing [closed]
Check the exit condition of your for loop: for (int i= 0; i> num_proyect_act; i++) { // … } 2 solved arrayindexoutofbounds exception processing [closed]
Check the exit condition of your for loop: for (int i= 0; i> num_proyect_act; i++) { // … } 2 solved arrayindexoutofbounds exception processing [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]
Processing is open source. You can find its source code on GitHub here. Java’s source is included with your JDK. But really, Stack Overflow isn’t really designed for general questions like this. Please try to do some more research, and try to ask a more specific question in the future. Good luck. 1 solved where … Read more
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
here you go, I added +5 to the x and y because one pixel was too small float x = 400, y=100; int a=20,b=10; void setup() { size(800, 200); } void draw() { background(200); // to erase the screen everyframe rect(x-a/2, y-b/2, a, b); } void keyPressed() { if (keyCode == RIGHT) { x+=5; } … Read more
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]
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
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
This would be the equivalent in python. In range(0, height, cellSize), 0 and height are the bounds of the range, and cellSize is how many out counter increments. for y in range(0, height, cellSize): for x in range(0, width, cellSize): rect(x, 0, cellSize, cellSize) 5 solved Python single line for loops [duplicate]
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