Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By Tolls

Thread: JavaFX : How to set icon for stage

  1. #1
    Join Date
    Jul 2014
    Posts
    5
    Rep Power
    0

    Question JavaFX : How to set icon for stage

    hi,
    As we can set title for stage using stage.setTitle("hello world") . but how can we set icon for stage that get displayed just before the Title of stage.

    - Kapil

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: JavaFX : How to set icon for stage

    Java FX Code:
    <stage>.getIcons().add(<your image>);
    Not the most obvious way of doing it, IMO, but it is an ObservableList so, presumably, triggers screen updates.

    You should also (as per the docs) provide a range of sizes as FX will try and pick the most suitable one to use, as this list is also used for the minimised icons.
    kapilkumar.java likes this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Join Date
    Jul 2014
    Posts
    5
    Rep Power
    0

Similar Threads

  1. JavaFX Book | Learn JavaFX More In Depth
    By SnakeDoc in forum JavaFX
    Replies: 0
    Last Post: 05-17-2013, 11:10 PM
  2. preverifying stage error
    By apoorva in forum Sun Java Wireless Toolkit
    Replies: 0
    Last Post: 03-26-2011, 03:23 PM
  3. JavaFX Script and JavaFX Mobile
    By levent in forum Java Software
    Replies: 1
    Last Post: 01-27-2010, 04:48 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •