# Looking for more resources about ArrayLists

**URL:** https://discourse.processing.org/t/looking-for-more-resources-about-arraylists/21025
**Category:** Beginners
**Created:** [May 18, 2020, 5:43pm UTC](https://discourse.processing.org/t/looking-for-more-resources-about-arraylists/21025 "2020-05-18T17:43:28Z")
**Posts on this page:** 1
**Showing post:** 25

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [May 23, 2020, 10:44pm UTC](https://discourse.processing.org/t/looking-for-more-resources-about-arraylists/21025/25 "2020-05-23T22:44:23Z")

</div>

**How to store the size of the rectangles**

You could make a second parallel ArrayList holding the size of it‘s cells (the two ArrayLists being a way to hold data; this you would do later with a class and objects stored in the ArrayList)

**This line**

This line:

> [@debxyz](#):
>
> `rect (pv.x/2, pv.y/2, tile/2, tile/2);`

This line should better add the rect to the two Arraylists instead, so a new rect would be added to the ArrayLists and then be displayed in draw() throughout.

- When you display a rectangle in mousePressed it flashes only briefly (when you use background() in draw()). So better add it to the lists that are displayed in draw() permanently.

Then in draw() use both lists to display rects with position and size.

Chrisir

---

_[View the full topic](https://discourse.processing.org/t/looking-for-more-resources-about-arraylists/21025)._
