# G4P not drawing background of label

**URL:** <https://discourse.processing.org/t/g4p-not-drawing-background-of-label/16261>\
**Category:** Libraries\
**Created:** [December 9, 2019, 10:14am UTC](https://discourse.processing.org/t/g4p-not-drawing-background-of-label/16261 "2019-12-09T10:14:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark\_orion](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mark_orion/32/7180_2.png) [@mark\_orion](https://discourse.processing.org/u/mark_orion)\
**Post date:** [December 9, 2019, 10:14am UTC](https://discourse.processing.org/t/g4p-not-drawing-background-of-label/16261/1 "2019-12-09T10:14:02Z")

</div>

I want to create a label with a distinctive background so that the actual box of the label is visible. However whatever color I define as background (color 6 in the color scheme) is only drawn right behind the text but not in the actual label box. As a result the text looks rather ugly with an outline in the color of the defined background and the label box is invisible:  
Left with “opaque background”, right with background defined in color 6.  
 ![g4pbackgrounds](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/430f0c69b932e5ce51bb0072ea2c7f6ae65d54fa.png)

I am aware of this post and setting the “opaque background” option does indeed make the text look good, but it does not solve the problem of the missing background in the box:

> [@G4P text is blurred without background()](https://discourse.processing.org/t/g4p-text-is-blurred-without-background/11489):
>
> Using Processing 3.5.3 and G4P V4.2.1 on Windows 7. Why does G4P control text get blurred when not clearing the display window at the beginning of each frame? [image] vs. [image] Here’s a simple example: import g4p\_controls.\*; boolean bgIsSelected = false; GCheckbox cb1; void setup() { createCheckboxGUI(); } void draw() { if (bgIsSelected) background(200); } void createCheckboxGUI() { cb1 = new GCheckbox(this, 5, 40, 100, 20); cb1.setText("Background"); cb1.addEventHandler(t…

---

<div class="post-metadata">

**Author:** ![mark\_orion](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mark_orion/32/7180_2.png) [@mark\_orion](https://discourse.processing.org/u/mark_orion)\
**Post date:** [December 9, 2019, 11:14am UTC](https://discourse.processing.org/t/g4p-not-drawing-background-of-label/16261/2 "2019-12-09T11:14:21Z")

</div>

Not a solution but an easy workaround: I am now using Textfields instead of Labels what allows me to set the proper background color and with .setTextEditEnabled(false) they behave like non-editable labels.
