Custom title bar in Javafx 2.0?

前端 未结 2 1109
醉话见心
醉话见心 2021-01-14 08:15

Is there any tutorial on how to create custom title bar in javafx 2.0? I am creating a desktop GUI app and want to have a black gradient title bar with custom buttons for mi

相关标签:
2条回答
  • 2021-01-14 08:27

    I don't think it's possible to modify the title bar directly. One of the solution could be to remove the platform decorations and add your custom "title bar" to the top of your windows. Here for an example : JavaFX primaryStage remove windows borders?

    0 讨论(0)
  • 2021-01-14 08:31

    To hide platform window:

    stage.initStyle(StageStyle.UNDECORATED);
    

    Now you can create your own titlebar/window-buttons & style them.

    Finally, check "Ensemble" from Oracle JavaFX samples, they've done the exact thing: http://www.oracle.com/technetwork/java/javafx/samples/index.html

    0 讨论(0)
提交回复
热议问题