How do I add an icon as a classpath resource to an SWT window created with WindowBuilder?

前端 未结 6 597
名媛妹妹
名媛妹妹 2021-02-07 09:48

I\'m trying to add an external icon from an *.ico file to a window that I\'m creating using the WindowBuilder design window. I can select the shell, which brings up an \"image\"

6条回答
  •  温柔的废话
    2021-02-07 10:05

    To easily add an icon to my classpath, I found my desired icon, right clicked it, selected "copy", then went to one of the packages of my project in Eclipse, right clicked, and selected "paste". The next time I brought up the image chooser dialog box, my local package had the icon listed as an available classpath resource, and I chose it. image chooser

    I was able to export the project to a runnable JAR, and the icon still worked.

提交回复
热议问题