# Is it possible to add charts or some values into a new window created by G4P?

**URL:** https://discourse.processing.org/t/is-it-possible-to-add-charts-or-some-values-into-a-new-window-created-by-g4p/21472
**Category:** Libraries
**Created:** [June 1, 2020, 8:08am UTC](https://discourse.processing.org/t/is-it-possible-to-add-charts-or-some-values-into-a-new-window-created-by-g4p/21472 "2020-06-01T08:08:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![SouSageYa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sousageya/32/9819_2.png) [@SouSageYa](https://discourse.processing.org/u/SouSageYa)
#### Post date: [June 1, 2020, 8:08am UTC](https://discourse.processing.org/t/is-it-possible-to-add-charts-or-some-values-into-a-new-window-created-by-g4p/21472/1 "2020-06-01T08:08:09Z")

</div>

I could manage to open a new window with G4P. But I couldnt figure out how to add values or charts boxes or something. Is there a way

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [June 1, 2020, 8:27am UTC](https://discourse.processing.org/t/is-it-possible-to-add-charts-or-some-values-into-a-new-window-created-by-g4p/21472/2 "2020-06-01T08:27:36Z")

</div>

The short answer is yes, simply add a draw handler to the new GWindow like this

```auto
import g4p_controls.*;

GWindow window;

void setup() {
  size(320, 240);
  window = GWindow.getWindow(this, "Another window", 100, 200, 480, 320, JAVA2D);
  window.addDrawHandler(this, "windowDraw");
}

void draw() {
  background(230);
  fill(255, 200, 200);
  stroke(155, 0, 155);
  strokeWeight(3);
  rect(20, 20, 200, 120);
}

void windowDraw(PApplet pa, GWinData data) {
  pa.background(32);
  pa.fill(255, 200, 200);
  pa.stroke(255, 255, 0);
  pa.strokeWeight(6);
  pa.rect(40, 30, 300, 180);
}

```

You can also add mouse handlers to the new window.

If you are new to G4P and Processing in general then I suggest that you install the GUI Builder tool which provides a visual design window to help you create GUIs with G4P.

There are G4P and GUI Builder guides including videos on my [website](http://lagers.org.uk) also look at the examples that come with G4P.

---

<div class="post-metadata">

### Author: ![SouSageYa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sousageya/32/9819_2.png) [@SouSageYa](https://discourse.processing.org/u/SouSageYa)
#### Post date: [June 1, 2020, 10:09am UTC](https://discourse.processing.org/t/is-it-possible-to-add-charts-or-some-values-into-a-new-window-created-by-g4p/21472/3 "2020-06-01T10:09:39Z")

</div>

I have already checked your website but I found it a bit confusing for a starter but thanks I appreciate it.
