0

How do you add the file icon to the titlebar in JavaFX on Mac? Like this:

enter image description here

And how do you indicate that the document hasn't been saved, like this:

enter image description here

In Swing, this is how you do it, but is it possible in JavaFX too?

jobukkit
  • 2,490
  • 8
  • 26
  • 41
  • http://stackoverflow.com/questions/26341744/javafx-set-different-icons-for-the-title-bar-and-the-operating-system-task-bar – user1582006 Apr 03 '15 at 18:15

1 Answers1

1

No pre-coded solution in this answer. The feature you request is not available out of the box with JavaFX 8.

Some approaches you could consider:

  1. See: JavaFX entirely customized windows? and the Undecorator project. Potentially you could use something like Undecorator in conjunction with resources from AquaFX to achieve what you want.

    OR

  2. Another way is to use two stages layered on top of each other, the top stage being transparent and overlaying the icon on the lower stage - you would need to keep them in sync for location, size, visibility and iconification states.
  3. Use a Swing stage and application which implements the icon and place the JavaFX content inside the Swing stage using a JFXPanel.
Community
  • 1
  • 1
jewelsea
  • 150,031
  • 14
  • 366
  • 406