1

I've been having trouble with my app's icon not showing up after I build the native installer in maven; however when I run the app within Eclipse the icon is displayed. The icon file Icon.png is located within the resources folder. Below is the Main class for my application, which configures the use of the icon file. Any suggestions?

public class Main extends Application
{
    private static final Logger logger = LogManager.getLogger(Main.class);
    private Parent rootLayout;
    private Stage primaryStage;
    private String title = "Cowley's Chaos Stat Parser";
    private static String log4jxml = "src/main/resources/com/sohjiro/log4j.xml";

    public static void main(String[] args)
    {
        DOMConfigurator.configure(log4jxml);
        launch(args);
    }

    @Override
    public void start(Stage stage)
    {
        try
        {
            primaryStage = stage;
            primaryStage.setTitle(title);
            primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("Icon.png")));
            rootLayout = FXMLLoader.load(getClass().getResource("Main.fxml"));
            Scene scene = new Scene(rootLayout);
            primaryStage.setScene(scene);
            primaryStage.show();
        }
        catch (Exception e)
        {
            logger.error("Main", e);
        }
    }

    public static Logger getLogger()
    {
        return logger;
    }
}
Daniel Cottone
  • 4,257
  • 24
  • 39
Sohjiro
  • 23
  • 4
  • This is not an eclipse way, but the naming conventions are the same, so have a look here: http://stackoverflow.com/a/31303338/4170073 – aw-think Jul 01 '16 at 17:16

0 Answers0