3

Since the start() method is final (cannot be overridden), and primaryStage has a private access in Mobile Application how can I set Icon on my program?

AtomX
  • 364
  • 2
  • 13
  • See for instance [Notes sample](https://github.com/gluonhq/gluon-samples/blob/master/notes/src/main/java/com/gluonhq/samples/notes/Notes.java#L50). – José Pereda Sep 21 '20 at 14:40
  • Sorry... I didn't pay enough attention to automatically plug-in generated project... – AtomX Sep 21 '20 at 15:11

1 Answers1

0

You can define a list of icons to a Stage instance:

primaryStage.getIcons().addAll(icon1, icon2, ...);

, where icon1, icon2 are instances of the Image class. The Image Javadoc explains that BMP, PNG, GIF and JPEG are the required formats but if I remember well, you can add a picture with the ICO format: icon1 = new Image("/.../logo.ico");

You can add all your icons to your application using that method. As explained in the Javadoc :

The images should be different sizes of the same image and the best size will be chosen, eg. 16x16, 32,32.

0009laH
  • 1,960
  • 13
  • 27