# Beginners

**URL:** https://discourse.processing.org/c/processing/processing-beginners/14.md?page=17

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 18

---

## [How to copy an array](https://discourse.processing.org/t/how-to-copy-an-array/5170)

<div class="topic-metadata">

**Author:** [@sLucas](https://discourse.processing.org/u/sLucas)\
**Replies:** 10\
**Last updated:** [August 16, 2021, 3:50am UTC](https://discourse.processing.org/t/how-to-copy-an-array/5170 "2021-08-16T03:50:45Z")

</div>

A bug has been found… (No bug has been found (edit)) Explanation follows void setup() { double\[\] a = {1, 2, 3}; double\[\] b = {1, 2, 3}; for (double print : b) { print(print + ", "); } println(); b = new…

---

## [A caught exception occured on thread](https://discourse.processing.org/t/a-caught-exception-occured-on-thread/31713)

<div class="topic-metadata">

**Author:** [@LuckSmith](https://discourse.processing.org/u/LuckSmith)\
**Replies:** 4\
**Last updated:** [August 15, 2021, 11:49am UTC](https://discourse.processing.org/t/a-caught-exception-occured-on-thread/31713 "2021-08-15T11:49:40Z")

</div>

Hi guys, I got the following error message running my sketch. Tried both 4.01 and 3.5.4 versions. What is wrong? RunnableTask.run(): A caught exception occured on thread main-Display-.windows\_nil-1-EDT-1: RunnableTask…

---

## [Can't use the original functions in processing 4.0's class?](https://discourse.processing.org/t/cant-use-the-original-functions-in-processing-4-0s-class/31694)

<div class="topic-metadata">

**Author:** [@LOOOOOOOOP](https://discourse.processing.org/u/LOOOOOOOOP)\
**Replies:** 2\
**Last updated:** [August 12, 2021, 7:06am UTC](https://discourse.processing.org/t/cant-use-the-original-functions-in-processing-4-0s-class/31694 "2021-08-12T07:06:41Z")

</div>

When I use rect(),or line() in classes, it works in processing 3. But I don’t know what is going on in processing 4. class t{ t(){} void test(){ rect(0,0,30,50); } } The function rect(int, int, int, int) do…

---

## [Get-the-average-rgb-from-pixels (revisited)](https://discourse.processing.org/t/get-the-average-rgb-from-pixels-revisited/31661)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 4\
**Last updated:** [August 11, 2021, 12:48am UTC](https://discourse.processing.org/t/get-the-average-rgb-from-pixels-revisited/31661 "2021-08-11T00:48:25Z")

</div>

@GoToLoop answered this but which of the two methods is better? Is there a reason to change the int for each of the three RGB channels to color??? Both methods work, I just want to understand. get-the-average-rgb-from-…

---

## [Processing bug - setting A (object) to B (object) and modifying A, it will change B too!](https://discourse.processing.org/t/processing-bug-setting-a-object-to-b-object-and-modifying-a-it-will-change-b-too/31627)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 3\
**Last updated:** [August 8, 2021, 9:07pm UTC](https://discourse.processing.org/t/processing-bug-setting-a-object-to-b-object-and-modifying-a-it-will-change-b-too/31627 "2021-08-08T21:07:31Z")

</div>

Hello everyone! There is an issue with PVectors and objects. If you do this: PVector a = new PVector(0,0); PVector b = new PVector(100,100); PVector c = a; c.lerp(b,0.5); println(a,c); //prints \[ 50.0, 50.0, 0.0 \] \[ 5…

---

## [The get() function with width and height not working](https://discourse.processing.org/t/the-get-function-with-width-and-height-not-working/31613)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 10\
**Last updated:** [August 8, 2021, 9:28am UTC](https://discourse.processing.org/t/the-get-function-with-width-and-height-not-working/31613 "2021-08-08T09:28:50Z")

</div>

The code is very simple and I am referring to \<https://processing.org/reference/get\_.html\> But when I try to use get(100, 100, 5, 5) I get the error “cannot convert from PImage to int”. Is it me, or the code? PImage im…

---

## [Variable inside a string](https://discourse.processing.org/t/variable-inside-a-string/31532)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 5\
**Last updated:** [August 4, 2021, 10:50pm UTC](https://discourse.processing.org/t/variable-inside-a-string/31532 "2021-08-04T22:50:02Z")

</div>

I want to make a string that changes depending on the variable so in my example hello and the number would have to touch, so no spaces and the x should be the number that x is Float x; Void draw(){ X=random(30); Print(H…

---

## [Arithmetic Order of Operation and Calculation](https://discourse.processing.org/t/arithmetic-order-of-operation-and-calculation/31559)

<div class="topic-metadata">

**Author:** [@Peace](https://discourse.processing.org/u/Peace)\
**Replies:** 2\
**Last updated:** [August 4, 2021, 11:11am UTC](https://discourse.processing.org/t/arithmetic-order-of-operation-and-calculation/31559 "2021-08-04T11:11:22Z")

</div>

Hello guys, I am looking for a complete list of how Arithmetic Order of Operation and Calculation operates in Procession. Can anybody please direct me where can I find that information ? Cheers guys :clinking\_glasses:

---

## [Zig Zag or Wavy or Spiral or Dotted lines 👀](https://discourse.processing.org/t/zig-zag-or-wavy-or-spiral-or-dotted-lines/31547)

<div class="topic-metadata">

**Author:** [@Peace](https://discourse.processing.org/u/Peace)\
**Replies:** 7\
**Last updated:** [August 3, 2021, 1:38pm UTC](https://discourse.processing.org/t/zig-zag-or-wavy-or-spiral-or-dotted-lines/31547 "2021-08-03T13:38:30Z")

</div>

Hi guys, I am a newbie to Processing ( by the way, I really liked this name, Processing :ok\_hand: ) and I have just learnt to draw vertical, horizons line, rect mode. Just wondering what will be the code for drawing Zig …

---

## [Ellipse following mouse](https://discourse.processing.org/t/ellipse-following-mouse/31489)

<div class="topic-metadata">

**Author:** [@ninjaasmoke](https://discourse.processing.org/u/ninjaasmoke)\
**Replies:** 1\
**Last updated:** [July 30, 2021, 5:52am UTC](https://discourse.processing.org/t/ellipse-following-mouse/31489 "2021-07-30T05:52:02Z")

</div>

I am new to processing and wanted to create a simple program where a circle follows the mouse. This is the code that I have, void setup () { size(400, 400, P3D); background(0); } void draw() { pushMatrix(); fi…

---

## [ColorMode and ARGB values](https://discourse.processing.org/t/colormode-and-argb-values/31379)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 3\
**Last updated:** [July 29, 2021, 1:41pm UTC](https://discourse.processing.org/t/colormode-and-argb-values/31379 "2021-07-29T13:41:33Z")

</div>

Just trying to figure out whats going on behind the scenes when using colorMode. it can be set to greater than 255, however the values retrieved from it are then not accurate. And it doesnt seem to have a definitive con…

---

## [Does a Table change a String format? (String equality)](https://discourse.processing.org/t/does-a-table-change-a-string-format-string-equality/31439)

<div class="topic-metadata">

**Author:** [@dtools22](https://discourse.processing.org/u/dtools22)\
**Replies:** 3\
**Last updated:** [July 26, 2021, 9:51am UTC](https://discourse.processing.org/t/does-a-table-change-a-string-format-string-equality/31439 "2021-07-26T09:51:45Z")

</div>

Hello, I am writing a program that calls for information to be pulled from a spread sheet (.csv format) and put into “tile” objects that exist in the program. The quick version of my question is that when I load a Str…

---

## [Change color with click or touch](https://discourse.processing.org/t/change-color-with-click-or-touch/31295)

<div class="topic-metadata">

**Author:** [@lion](https://discourse.processing.org/u/lion)\
**Replies:** 7\
**Last updated:** [July 25, 2021, 12:11pm UTC](https://discourse.processing.org/t/change-color-with-click-or-touch/31295 "2021-07-25T12:11:10Z")

</div>

Good day, everyone! A beginner here. I’m trying to change the colors of a few squares whenever the mouse click upon them but can’t figure out a working solution. Here is what I’ve done so far: I created four values and…

---

## [I want to masking](https://discourse.processing.org/t/i-want-to-masking/31382)

<div class="topic-metadata">

**Author:** [@jih](https://discourse.processing.org/u/jih)\
**Replies:** 1\
**Last updated:** [July 22, 2021, 2:16pm UTC](https://discourse.processing.org/t/i-want-to-masking/31382 "2021-07-22T14:16:23Z")

</div>

Hello, I want masking what moves. source : ( Hue \\ Examples \\ Processing.org ) int barWidth = 20; int lastBar = -1; int whichBar = mouseX / barWidth; if (whichBar != lastBar) { int barX = whichBar \* barWidth; fill…

---

## [I want to this contents in a circle](https://discourse.processing.org/t/i-want-to-this-contents-in-a-circle/31375)

<div class="topic-metadata">

**Author:** [@jih](https://discourse.processing.org/u/jih)\
**Replies:** 3\
**Last updated:** [July 22, 2021, 1:11pm UTC](https://discourse.processing.org/t/i-want-to-this-contents-in-a-circle/31375 "2021-07-22T13:11:13Z")

</div>

Hello, I’m studying with this example. (Hue) Hue \\ Examples \\ Processing.org I want to make a circle, and put this content in the circle. I tried, but the whole circle changes color. How do I put it in a circle? Tha…

---

## [Help with Processing Brightness Example](https://discourse.processing.org/t/help-with-processing-brightness-example/31366)

<div class="topic-metadata">

**Author:** [@jih](https://discourse.processing.org/u/jih)\
**Replies:** 2\
**Last updated:** [July 21, 2021, 9:37pm UTC](https://discourse.processing.org/t/help-with-processing-brightness-example/31366 "2021-07-21T21:37:48Z")

</div>

https://processing.org/examples/brightness.html hello, I’m studying with this tutorial. almost last line, pixels\[y\*width+x\] = c; \<\< ArrayIndexOutOfBoundsException: 230400 error… Please let me know how. Thank you…

---

## [Report Number of Key Clicks During Timer](https://discourse.processing.org/t/report-number-of-key-clicks-during-timer/31364)

<div class="topic-metadata">

**Author:** [@BruceTheWayneJohnson](https://discourse.processing.org/u/BruceTheWayneJohnson)\
**Replies:** 3\
**Last updated:** [July 21, 2021, 8:37pm UTC](https://discourse.processing.org/t/report-number-of-key-clicks-during-timer/31364 "2021-07-21T20:37:03Z")

</div>

I am currently trying to get my program to print how many times ‘a’ is pressed while the timer counts to 2000ms. So far, all I can get printed is some wildly larger number than how many times I pressed ‘a’. It says anyw…

---

## [Not sure why my array is not allowed to use a function (OOP)](https://discourse.processing.org/t/not-sure-why-my-array-is-not-allowed-to-use-a-function-oop/31232)

<div class="topic-metadata">

**Author:** [@LuckyDots](https://discourse.processing.org/u/LuckyDots)\
**Replies:** 21\
**Last updated:** [July 14, 2021, 12:13pm UTC](https://discourse.processing.org/t/not-sure-why-my-array-is-not-allowed-to-use-a-function-oop/31232 "2021-07-14T12:13:35Z")

</div>

hello again, my problem is as follows. I am have tried and somewhat suceeded in creating a function which creates a fade from black to white after a random amount of time and then resets itself. i am trying to fill the…

---

## [Tips for Sharing My Work on Different Machines](https://discourse.processing.org/t/tips-for-sharing-my-work-on-different-machines/31241)

<div class="topic-metadata">

**Author:** [@dtools22](https://discourse.processing.org/u/dtools22)\
**Replies:** 2\
**Last updated:** [July 13, 2021, 10:09pm UTC](https://discourse.processing.org/t/tips-for-sharing-my-work-on-different-machines/31241 "2021-07-13T22:09:50Z")

</div>

Hello Everyone, I have been working on a project for the past several months and I am ready to show this version of it beyond just immediate friends and family. I don’t need coding help, I’m looking for people to actua…

---

## [A quick question about the 1st chapter of Processing](https://discourse.processing.org/t/a-quick-question-about-the-1st-chapter-of-processing/31230)

<div class="topic-metadata">

**Author:** [@Peace](https://discourse.processing.org/u/Peace)\
**Replies:** 5\
**Last updated:** [July 13, 2021, 2:49pm UTC](https://discourse.processing.org/t/a-quick-question-about-the-1st-chapter-of-processing/31230 "2021-07-13T14:49:01Z")

</div>

Can anybody also please help me with my following query ? In the page 6 of the Processing textbook, a line has been drawn ( as can be seen in the attached picture Figure 1-6) on a graph paper and I can’t understand how t…

---

## [I am beginner of Processing software and need help! (mouse example issue)](https://discourse.processing.org/t/i-am-beginner-of-processing-software-and-need-help-mouse-example-issue/31228)

<div class="topic-metadata">

**Author:** [@Peace](https://discourse.processing.org/u/Peace)\
**Replies:** 3\
**Last updated:** [July 13, 2021, 10:35am UTC](https://discourse.processing.org/t/i-am-beginner-of-processing-software-and-need-help-mouse-example-issue/31228 "2021-07-13T10:35:43Z")

</div>

Hi there, I have installed a software from Processing.org and it is responding the way as described in the text book. After installing the software, click on the File button, then Examples then Drawing then double click …

---

## [loadStrings function not as reference?](https://discourse.processing.org/t/loadstrings-function-not-as-reference/31149)

<div class="topic-metadata">

**Author:** [@RichardDL](https://discourse.processing.org/u/RichardDL)\
**Replies:** 6\
**Last updated:** [July 11, 2021, 1:54pm UTC](https://discourse.processing.org/t/loadstrings-function-not-as-reference/31149 "2021-07-11T13:54:05Z")

</div>

I’ve just tried the first example on the \[loadStrings reference\](file:///C:/Programs/Processing/modes/java/reference/loadStrings\_.html) page. It works perfectly loading list.txt from the sketch’s folder, but not from th…

---

## [What does the % mean in the following code below](https://discourse.processing.org/t/what-does-the-mean-in-the-following-code-below/31143)

<div class="topic-metadata">

**Author:** [@bopStu77](https://discourse.processing.org/u/bopStu77)\
**Replies:** 9\
**Last updated:** [July 10, 2021, 12:55pm UTC](https://discourse.processing.org/t/what-does-the-mean-in-the-following-code-below/31143 "2021-07-10T12:55:41Z")

</div>

int x = 35; int cols, rows; void setup() { size(280,280); strokeWeight(2); cols = width/x; rows = height/x; } void draw() { for (int m = 0; m \< cols; m++) { for (int n = 0; n \< rows; n++) { \*\*\*if ((m % 2 == …

---

## [Problem PGraphics and export of images/video](https://discourse.processing.org/t/problem-pgraphics-and-export-of-images-video/31050)

<div class="topic-metadata">

**Author:** [@MyNameIsHere](https://discourse.processing.org/u/MyNameIsHere)\
**Replies:** 1\
**Last updated:** [July 4, 2021, 9:28pm UTC](https://discourse.processing.org/t/problem-pgraphics-and-export-of-images-video/31050 "2021-07-04T21:28:19Z")

</div>

I’m stuck and now turn to the forum because I can’t seem to find a solution online that works with that specific sketch and I assume as a beginner I’m not seeing something obvious or basic here. I was playing with a ske…

---

## [Not sure why rotation isn't giving certain values](https://discourse.processing.org/t/not-sure-why-rotation-isnt-giving-certain-values/31035)

<div class="topic-metadata">

**Author:** [@LuckyDots](https://discourse.processing.org/u/LuckyDots)\
**Replies:** 3\
**Last updated:** [July 4, 2021, 10:04am UTC](https://discourse.processing.org/t/not-sure-why-rotation-isnt-giving-certain-values/31035 "2021-07-04T10:04:11Z")

</div>

Okay so I’ve followed a tutorial on youtube for creating kaleidoscope type images which is from the following link https://www.youtube.com/watch?v=R3C2giDfmO8 the video is done in p5.js so im not surprised it hasn’t wor…

---

## [Force screen to update](https://discourse.processing.org/t/force-screen-to-update/30954)

<div class="topic-metadata">

**Author:** [@pack.mcmeta](https://discourse.processing.org/u/pack.mcmeta)\
**Replies:** 7\
**Last updated:** [June 29, 2021, 8:30pm UTC](https://discourse.processing.org/t/force-screen-to-update/30954 "2021-06-29T20:30:50Z")

</div>

My question is if I can force processing to update the display window after I call functions like rect() or arc(). So those functions would be called, then I could do something to have them display on screen before draw(…

---

## [How to set default value of a 2D array?](https://discourse.processing.org/t/how-to-set-default-value-of-a-2d-array/27948)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 8\
**Last updated:** [June 29, 2021, 1:18pm UTC](https://discourse.processing.org/t/how-to-set-default-value-of-a-2d-array/27948 "2021-06-29T13:18:15Z")

</div>

Hi! When I used to use 2D fixed arrays (int\[\]\[\], or int\[\] for that matter) it was always a bit annoying setting the values. Like default boolean state in an array is false. Is it possible to set it to something else wit…

---

## [Please help! Processing is showing loadTable is not defined?](https://discourse.processing.org/t/please-help-processing-is-showing-loadtable-is-not-defined/30816)

<div class="topic-metadata">

**Author:** [@ShenpaiSharma](https://discourse.processing.org/u/ShenpaiSharma)\
**Replies:** 11\
**Last updated:** [June 28, 2021, 3:34pm UTC](https://discourse.processing.org/t/please-help-processing-is-showing-loadtable-is-not-defined/30816 "2021-06-28T15:34:14Z")

</div>

Want to import csv data in Processing but it is showing loadTable is not defined… Error: jQuery.Deferred exception: loadTable is not defined ReferenceError: loadTable is not defined at Processing.Processing.setup (eva…

---

## [Loading multiple images with a wildcard?](https://discourse.processing.org/t/loading-multiple-images-with-a-wildcard/30866)

<div class="topic-metadata">

**Author:** [@Mat100](https://discourse.processing.org/u/Mat100)\
**Replies:** 6\
**Last updated:** [June 23, 2021, 2:11pm UTC](https://discourse.processing.org/t/loading-multiple-images-with-a-wildcard/30866 "2021-06-23T14:11:14Z")

</div>

Hi, How do I load images numbered 0000 - 0100? I have a series of images "frame-0000.png to “frame-0100.png” If I use this code… for (int i = 0; i \< images.length; i ++ ) { images\[i\] = loadImage( "frame-000" + i …

---

## [Illegal modifier for the local class Notepad; only abstract or final is permitted](https://discourse.processing.org/t/illegal-modifier-for-the-local-class-notepad-only-abstract-or-final-is-permitted/30831)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 1\
**Last updated:** [June 23, 2021, 6:34am UTC](https://discourse.processing.org/t/illegal-modifier-for-the-local-class-notepad-only-abstract-or-final-is-permitted/30831 "2021-06-23T06:34:33Z")

</div>

why does my code return the error: Illegal modifier for the local class Notepad; only abstract or final is permitted this is the code: \`int x=1; int y=1; color ring1 = color(0,0,0); color ring2 = color(0,0,0); color r…

[Previous page](https://discourse.processing.org/c/processing/processing-beginners/14.md?page=16)

[Next page](https://discourse.processing.org/c/processing/processing-beginners/14.md?page=18)
