# Two G4P GPanel questions (setTextAlign and resize)

**URL:** <https://discourse.processing.org/t/two-g4p-gpanel-questions-settextalign-and-resize/47797>\
**Category:** Libraries\
**Created:** [January 25, 2026, 1:21pm UTC](https://discourse.processing.org/t/two-g4p-gpanel-questions-settextalign-and-resize/47797 "2026-01-25T13:21:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sterretje](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sterretje](https://discourse.processing.org/u/sterretje)\
**Post date:** [January 25, 2026, 1:21pm UTC](https://discourse.processing.org/t/two-g4p-gpanel-questions-settextalign-and-resize/47797/1 "2026-01-25T13:21:59Z")

</div>

I have two questions about the GPanel

### one

According to the G4p reference GPanel is derived from GTextBase. The GTextBase class has a method setTextAlign but that does not seem to give the desired effect. I would like to horizontally centre the text in the tab.

```processing
import processing.javafx.*;
import g4p_controls.*;

void settings()
{
  // suppress windows scaling; see https://discourse.processing.org/t/windows-ui-scaling-not-respected/45905/5
  // note: System.setProperty("glass.win.uiScale", "1"); needs to be executed in setting, does not seem to have an effect in setup().
  System.setProperty("glass.win.uiScale", "1");
  size(800, 600, FX2D);
  smooth();
}

GPanel panel;

void setup()
{
  panel = new GPanel(this, 2, 2, 400, 300, "Hello");
  panel.setFont(new java.awt.Font("Calibri", java.awt.Font.PLAIN, 20));
  panel.setTextAlign(GAlign.RIGHT, GAlign.BOTTOM);
}

```

Am I doing something wrong? Or do I misunderstand the functionality?

### two

I have a GPanel with a number of children. The last child is a label (to display an error message) is located at the bottom of the panel and will only show if an error message is displayed using setVisible(). I would like to know if it’s possible to resize a panel once it’s created; I could not find a method to achieve this.

The preferred layout would be  
**No error**

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/2/f/2f4f0ae6e4a2835f554ca2a8400292d8cf75c95e.png)  
**Error** (note the difference in height)  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/0/1/01ec5818bdb8e8035c19ad939c9784f9390ece8c.png)

---

<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:** [January 25, 2026, 4:51pm UTC](https://discourse.processing.org/t/two-g4p-gpanel-questions-settextalign-and-resize/47797/2 "2026-01-25T16:51:30Z")

</div>

**one**  
It’s not possible to set the text alignment in the panel bar. When the panel is collapsed the title bar shrinks which would require the text to move as well.

**two**  
There are no public methods available to resize a control after it has been created.

Sorry that I can’t help but unfortunately it is not practical to provide all the functionality that might possibly be wanted.

---

<div class="post-metadata">

**Author:** ![sterretje](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sterretje](https://discourse.processing.org/u/sterretje)\
**Post date:** [January 25, 2026, 7:27pm UTC](https://discourse.processing.org/t/two-g4p-gpanel-questions-settextalign-and-resize/47797/3 "2026-01-25T19:27:11Z")

</div>

Thanks for the reply.

For the first one I wasn’t sure.  
For the second one I did suspect that.
