# Tried to remove the top bar

**URL:** <https://discourse.processing.org/t/tried-to-remove-the-top-bar/42647>\
**Category:** Coding Questions\
**Created:** [August 23, 2023, 9:53pm UTC](https://discourse.processing.org/t/tried-to-remove-the-top-bar/42647 "2023-08-23T21:53:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuhuhwy](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/nuhuhwy/32/18485_2.png) [@nuhuhwy](https://discourse.processing.org/u/nuhuhwy)\
**Post date:** [August 23, 2023, 9:53pm UTC](https://discourse.processing.org/t/tried-to-remove-the-top-bar/42647/1 "2023-08-23T21:53:42Z")

</div>

I tried to remove the top bar with chatGpt but sadly i cant get it to work and i cant find anything in the forums!

```auto
import processing.javafx.*;
import javax.swing.JFrame;
import processing.core.PApplet;
import processing.javafx.*;
import javafx.embed.swing.JFXPanel;
import javafx.application.Platform;
import javafx.stage.Stage;
import javafx.scene.Scene;

PApplet parent;

void setup() {
  size(400, 300, FX2D);
  parent = this;

  removeTitleBar();
  
  background(220);
  fill(255, 0, 0);
  ellipse(width / 2, height / 2, 100, 100);
}

void removeTitleBar() {
  JFXPanel jfxPanel = (JFXPanel) ((PGraphicsFX2D) g).getNative();
  
  Platform.runLater(() -> {
    Stage stage = (Stage) jfxPanel.getScene().getWindow();
    stage.initStyle(StageStyle.UNDECORATED);
    
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    stage.setX((screenSize.getWidth() - stage.getWidth()) / 2);
    stage.setY((screenSize.getHeight() - stage.getHeight()) / 2);
  });
}

void draw() {
}

```

---

<div class="post-metadata">

**Author:** ![PerryJohnson](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@PerryJohnson](https://discourse.processing.org/u/PerryJohnson)\
**Post date:** [August 24, 2023, 1:28am UTC](https://discourse.processing.org/t/tried-to-remove-the-top-bar/42647/2 "2023-08-24T01:28:50Z")

</div>

You can search this forum for `setUndecorated` and find many answers.

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [August 24, 2023, 8:48am UTC](https://discourse.processing.org/t/tried-to-remove-the-top-bar/42647/3 "2023-08-24T08:48:05Z")

</div>

Hi @nuhuhwy,

You can take a look at this thread:

> [@Possible to change top bars layout? (window frame color)](https://discourse.processing.org/t/possible-to-change-top-bars-layout-window-frame-color/40914/2):
>
> Hi @Aryszin, In Windows, the title bar can be customized using the Windows API in C#: [Title bar customization - Windows apps | Microsoft Learn](https://learn.microsoft.com/en-us/windows/apps/develop/title-bar?tabs=wasdk) You can access the [java.awt.Frame](https://docs.oracle.com/javase/7/docs/api/java/awt/Frame.html) instance like this and modify it’s shape for example (you can make it transparent [here](https://docs.oracle.com/javase/tutorial/displayCode.html?code=https://docs.oracle.com/javase/tutorial/uiswing/examples/misc/ShapedWindowDemoProject/src/misc/ShapedWindowDemo.java)) : import processing.awt.PSurfaceAWT; import java.awt.Frame; import java.awt.geom.Ellipse2D; void setup() { size(500, 500); PSurfaceAWT.SmoothCanvas canvas = (PSurfaceAWT.SmoothCanvas)(surface.getNative()); Frame frame = ca…
