# PSurfaceAWT.SmoothCanvas\_SquareNuisance

**URL:** https://discourse.processing.org/t/psurfaceawt-smoothcanvas-squarenuisance/35447
**Category:** Coding Questions
**Created:** [February 25, 2022, 7:34pm UTC](https://discourse.processing.org/t/psurfaceawt-smoothcanvas-squarenuisance/35447 "2022-02-25T19:34:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [February 25, 2022, 7:34pm UTC](https://discourse.processing.org/t/psurfaceawt-smoothcanvas-squarenuisance/35447/1 "2022-02-25T19:34:50Z")

</div>

Other than setting the canvas bounds outside of the frame is there any way to get rid of this pesky colored square?

```auto
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

javax.swing.JFrame frame;
java.awt.Canvas canvas;

void setup() {
  frame = (javax.swing.JFrame) ((processing.awt.PSurfaceAWT.SmoothCanvas) surface.getNative()).getFrame();
  println("frame = " + frame);
  canvas = (processing.awt.PSurfaceAWT.SmoothCanvas) ((processing.awt.PSurfaceAWT)surface).getNative();
  println("canvas = " + canvas);
  frame.setBounds(500, 300, 400, 200);
 // canvas.setBounds(500, 300, 400, 200); // To avoid seeing default canvas square
}

```

 ![canvas_square](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/1dddb34a8713b9179423ee49c55a3f83f1878dbb.png)

---

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [February 25, 2022, 9:16pm UTC](https://discourse.processing.org/t/psurfaceawt-smoothcanvas-squarenuisance/35447/2 "2022-02-25T21:16:39Z")

</div>

It appears ‘frame.remove(canvas);’ \_may be the answer; hopefully I can display components without having the canvas.
