问题
How can I change the icon image of my JavaFX application?
And is possible to run my application without java installed on computer?
回答1:
stage.getIcons().add(new Image("yourImage.extension"));
回答2:
You can set the image of your primary stage
@Override
public void start(final Stage stage)
{
stage.getIcons().add(new Image("icon.png"));
}
And yes you can run your application on a system without the run-time, for this you must have the run-time embedded in your application
回答3:
In regards to your second question, I know this exists, but I never used it. That would be a self contained app. Check this site:
http://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm
来源:https://stackoverflow.com/questions/21690249/change-icon-image-javafx