Lson
Lson

Reputation: 187

How to change javafx stage top region

I want to use javaFx to make stage top region like IDEA menu bar,but i can not find any api in stage to set node .Second picture is my app,the menu bar is in BorderPane top,how to move to stage top?

enter image description here

enter image description here

Upvotes: 1

Views: 201

Answers (1)

tricksSpecialist
tricksSpecialist

Reputation: 156

a possible option is to use a window without decoration stage.initStyle(StageStyle.UNDECORATED); by doing this you remove the 3-buttons and will have an empty stage so you can control it and add whatever you want and for more info you can find an example that serve your case inside this link:
JavaFx add Window-Control-Buttons to Menubar (IntelliJ like)

Upvotes: 2

Related Questions