0

I've tried a lot to remove the stage buttons in my JFX project frame. I'm using a decorator to fresh up the design.

enter image description here

I only want to remove the maximize, resize and minimize buttons. The close button should not be removed. Can you give me a tip, how I can deal with this?

JFXDecorator decorator = new JFXDecorator(primaryStage, gridContainer);

I've tried this to remove the resizable button this way:

primaryStage.setResizable(false);

.jfx-decorator{
    -fx-decorator-color: #2196F3;
    -fx-text-fill: black;
    -fx-background-color: transparent;
    -fx-border-color: #2196F3;
}

.jfx-decorator .jfx-decorator-buttons-container{
    -fx-background-color: -fx-decorator-color;
}

.jfx-decorator .resize-border{
    -fx-border-color: #2196F3;
    -fx-border-width: 0 4 4 4;
}
.jfx-decorator .jfx-decorator-buttons{
    -fx-background-color: red;
}
Melowski
  • 21
  • 7

2 Answers2

3

You have to pass the exact number of arguments. boolean values are...

1 full screen

2 Maximize/Restore

3 Minimize

JFXDecorator decorator = new JFXDecorator(mainStage, root, false, false, false);
Safwan Muhammed
  • 117
  • 1
  • 8
0

It is actually pretty simple. If you take a look into the constructor of the decorator:

public JFXDecorator(Stage stage, Node node) { this(stage, node, true, true, true); }

You can set the three Boolean values to false, which exceeds to the wanted solution.

Melowski
  • 21
  • 7