1

I Have problem with displaying my ICON IMAGE in Application JAR using Linux Ubuntu.

No problem in Windows or Mac OS.

No exception displayed, but i don't get the image in the Linux unity launcher bar.

 BufferedImage logo;
    try {
        logo = ImageIO.read((InputStream) Thread.currentThread()
                .getContextClassLoader()
                .getResourceAsStream("com/econorma/ui/resources/logo.png")); 
        getMainFrame().setIconImage(logo);
    } catch (IOException e1) {
        getMainFrame().setIconImage(null);
    }
Harald K
  • 26,314
  • 7
  • 65
  • 111
Alessandro Mattiuzzi
  • 2,309
  • 2
  • 18
  • 24
  • 1
    Try to put a `/` before your path: `/com/econorma/ui/resources/logo.png`. Just a wild guess thoughm usually apps that run in MAC OS run on linux without problems too. – user432 May 22 '14 at 10:45
  • What is the problem? If you get an Exception, post the stack trace. If not, describe the symptoms better! :-) – Harald K May 22 '14 at 11:03
  • Also putting the backslash before the package not work here – Alessandro Mattiuzzi May 22 '14 at 12:14
  • So, if I understand correctly, the problem is that `JFrame.setIconImage(..)` doesn't do what you expect on Linux when run from JAR? But it works if you run from command line or IDE? I deleted my answer and re-tagged the question to fit with this understanding. – Harald K May 22 '14 at 12:48
  • Launching from IDE or from runnable JAR don't show icon image ONLY using Linux. Same JAR is running on Mac OS and Windows and the factory icon image is show normally. – Alessandro Mattiuzzi May 22 '14 at 13:07
  • That's not the most effective way to catch an exception. Use something that will actually debug the situation. – Paul Samsotha May 22 '14 at 13:46
  • Verify that your JAR actually contains the resource, as suggested [here](http://stackoverflow.com/a/2201870/230513). – trashgod May 22 '14 at 18:36

0 Answers0