# Possible to change top bars layout? (window frame color)

**URL:** <https://discourse.processing.org/t/possible-to-change-top-bars-layout-window-frame-color/40914>\
**Category:** Coding Questions\
**Created:** [February 13, 2023, 4:49pm UTC](https://discourse.processing.org/t/possible-to-change-top-bars-layout-window-frame-color/40914 "2023-02-13T16:49:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aryszin](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Post date:** [February 13, 2023, 4:49pm UTC](https://discourse.processing.org/t/possible-to-change-top-bars-layout-window-frame-color/40914/1 "2023-02-13T16:49:47Z")

</div>

Is it possible to change how the bar looks in Windows, where the minimize, window & exit buttons are. Can you change the color of that?

---

<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:** [February 17, 2023, 1:26pm UTC](https://discourse.processing.org/t/possible-to-change-top-bars-layout-window-frame-color/40914/2 "2023-02-17T13:26:38Z")

</div>

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)) :

```processing
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 = canvas.getFrame();
  
  frame.removeNotify();
  frame.setUndecorated(true);
  frame.setShape(new Ellipse2D.Double(0, 0, width, height));
  frame.addNotify();
}

```

But I don’t know if the Java API can access and modify the style of the title bar. You might want to investigate more:

> <https://stackoverflow.com/questions/2482971/how-to-change-the-color-of-titlebar-in-jframe>

> <https://stackoverflow.com/questions/7553146/java-awt-remove-frame-title-bar-and-add-customised-title-bar>

---

<div class="post-metadata">

**Author:** ![Aryszin](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Post date:** [March 4, 2023, 2:08pm UTC](https://discourse.processing.org/t/possible-to-change-top-bars-layout-window-frame-color/40914/3 "2023-03-04T14:08:48Z")

</div>

it says “cannot find class or type named PSurfaceAWT” do you know a fix? ary

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [March 4, 2023, 3:26pm UTC](https://discourse.processing.org/t/possible-to-change-top-bars-layout-window-frame-color/40914/4 "2023-03-04T15:26:03Z")

</div>

Hi @Aryszin,

add this on top…

```auto
import processing.awt.PSurfaceAWT;

```

Cheers  
— mnse
