Saturn
Saturn

Reputation: 18139

JavaFX disable Maximize button from StageStyle.Utility

I am initializing my stage with StageStyle.Utility. This is how the buttons look like:

enter image description here

One is the close button, which is fine. Minimize is disable, which is great. But... Maximize is there. I don't want my utility window to be able to maximize.

I have disabled Resizing, but at least on Mac it is still able to maximize. How do I disable this? (I DO want to have StageStyle.Utility).

Edit: This is how it looks when I hover the mouse on either of them:

enter image description here

It is an 'X', but it does NOT close the window! It maximizes it!

Upvotes: 2

Views: 3587

Answers (1)

ItachiUchiha
ItachiUchiha

Reputation: 36722

Use

stage.setResizable(false);

along with

stage.initStyle(StageStyle.UTILITY);

It disables both maximize and minimize options.

enter image description here

Upvotes: 4

Related Questions