Git Product home page Git Product logo

Comments (7)

shannah avatar shannah commented on August 29, 2024

Speculation: JavaFX might need to set the icon for the stage.
https://stackoverflow.com/questions/10121991/javafx-application-icon

E.g. Perhaps, in the absence of setting the stage icon explicitly, it is defaulting to no icon -- or perhaps it tries to extract the icon from the binary launcher, but there is no icon there.

So two possible workarounds if this hypothesis is correct:

  1. Find a way to embed icon into binary in form that JavaFX can deal with.
  2. Explicitly set stage icon in app.

Again... this is only speculation... need to run some tests to find out.

from jdeploy.

shannah avatar shannah commented on August 29, 2024

Experiment 1: Tried running using java directly:
java -jar jfxcentral-1.0.jar

Got same result: Taskbar icon is blank.

I was using the same Azul jre17+fx distribution for this test.

from jdeploy.

shannah avatar shannah commented on August 29, 2024

I have confirmed that adding an icon to the stage explicitly will work around this issue, and display the icon correctly on Ubuntu.

See the ensemble8 demo for an example.

Not sure if this is a bug in JavaFX, or the Azul distributions yet, or if this is expected behaviour. Also don't know if there is a way to provide a default icon using System properties.

@dlemmermann Do you know if there is a system property available to set the default Stage icon? I haven't been able to find anything.

from jdeploy.

dlemmermann avatar dlemmermann commented on August 29, 2024

No, I do not think there is one. You have to add it to the stage via API. However, there is a known issue: https://bugs.openjdk.java.net/browse/JDK-8204936

from jdeploy.

dlemmermann avatar dlemmermann commented on August 29, 2024

Looks like it is not 100% reliable.

from jdeploy.

shannah avatar shannah commented on August 29, 2024

For now, then, the best I can do is add this to the documentation, and perhaps add a notice in the jdeploy GUI when you add an icon to point you to the workaround.

It is possible that this is Azul-specific, and that it could be resolved by switching to another distribution. I plan to add support for other distributions anyways, but Azul is nice because they provide the jre+fx and jdk+fx distros, which I haven't seen anywhere else - i.e. I'll have to roll my own JavaFX solution.

from jdeploy.

shannah avatar shannah commented on August 29, 2024

I've added a note about this in the developer guide.

NOTE: If you are using JavaFX you should also add your icon to your app's Stage using stage.getIcons().add(...) as there is a https://github.com/shannah/jdeploy/issues/53[bug] in Ubuntu that will cause the app's icon to appear blank in the taskbar otherwise.

I'm going to close this issue as I don't think there's much that can be done here.

from jdeploy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.