# How to Drop Popups with given info

**URL:** <https://discourse.processing.org/t/how-to-drop-popups-with-given-info/10922>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [May 4, 2019, 10:34pm UTC](https://discourse.processing.org/t/how-to-drop-popups-with-given-info/10922 "2019-05-04T22:34:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elangit](https://avatars.discourse-cdn.com/v4/letter/e/ac8455/32.png) [@elangit](https://discourse.processing.org/u/elangit)\
**Post date:** [May 4, 2019, 10:34pm UTC](https://discourse.processing.org/t/how-to-drop-popups-with-given-info/10922/1 "2019-05-04T22:34:14Z")

</div>

I get confused on this step of the homework and the function is supposed to:

“The behavior of this method should be as follows:  
Given data on one earthquake, and the x, y coordinates of the center of its corresponding circle, draw a rectangular “popup” that contains the “title” text”

Here is what I have so far

```auto
void drawPopup(JSONObject datum, int x, int y) {
  draw (fill(180, 180, 180);
  rect(x+5, y+10, 50, 20) String Title;
}

```

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [May 5, 2019, 2:16am UTC](https://discourse.processing.org/t/how-to-drop-popups-with-given-info/10922/2 "2019-05-05T02:16:16Z")

</div>

please format your code:

- in processing IDE use [ctrl][t]
- in forum editor press the

```auto
</> code tag

```

and get the

> ```  
> paste your code in here  
> ```

or just use keyboard and type the 2 lines with the ```

* * *

but sorry, that code what you show is not worth posting,  
insofar only shows your current status in respect of learning Processing and possibly  
also, your problem to find/learn from examples ( and the reference )  
[Reference / Processing.org](https://processing.org/reference/) like:  
[draw() / Reference / Processing.org](https://processing.org/reference/draw_.html)  
[fill() / Reference / Processing.org](https://processing.org/reference/fill_.html)  
[rect() / Reference / Processing.org](https://processing.org/reference/rect_.html)  
[loadJSONObject() / Reference / Processing.org](https://processing.org/reference/loadJSONObject_.html)

i hope you not try with this to find someone here to write/code the homework for you.  
! we are not allowed to! ( like some teachers say we would help you cheating… )

so again, we can help with commands, ideas, tips… but  
the code you post should run so we can test it here,  
but it looks like you not even try to type that in the IDE and work on the errors  
you must get.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 5, 2019, 6:43pm UTC](https://discourse.processing.org/t/how-to-drop-popups-with-given-info/10922/3 "2019-05-05T18:43:45Z")

</div>

> [@elangit](#):
>
> Here is what I have so far

When you put that in the Processing PDE, what specific messages does the Errors tab show you? Maybe start with the first one, and try to fix them one at a time.

You may also want to look at the introduction tutorial before looking at the reference – the way you are using `draw()` suggests you’ve never read an intro to Processing or looked at the first examples. Try:

> **[Getting Started](https://processing.org/tutorials/gettingstarted/)**
>
> Welcome to Processing! This introduction covers the basics of writing Processing code.

Or, if you prefer video, watch:

[https://hello.processing.org/](https://hello.processing.org/)

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [May 5, 2019, 6:46pm UTC](https://discourse.processing.org/t/how-to-drop-popups-with-given-info/10922/4 "2019-05-05T18:46:24Z")

</div>

Also related to your previous post: [Need Help with the boolean and making titles](https://discourse.processing.org/t/need-help-with-the-boolean-and-making-titles/10920)
