Giving an application a window icon in a sensible way



Hrm. How to go about doing this?

I want to give a Java application a window icon in a manner that is
independent of how it is installed, etc.

The trick is obtaining an Image object for myJFrame.setIconImage().
Loading it from a URL means it won't work without a working network
connection, and I need to host the image somewhere. Every copy of the
app running anywhere in the world will, on startup, hit that host with
a request for the file(!). Loading it from a file path requires a
separate installer that sets the image into a specific directory.
Putting it in a JAR file with the app means learning a big new chunk of
API, plus it won't work when running in the development environment
rather than as a standalone executable JAR.

This suggests doing the ListMessageBundle sort of thing, and somehow
packaging it as a class -- an Image subclass, presumably. Is there a
tool for turning a jpeg, gif, or png into Java source code for an Image
subclass that will, when instantiated, behave as the appropriate jpeg?

I don't have the google-fu to find this -- searches for queries like
"image resource class java" didn't do much for me. Damn, we need *real*
natural language search. :P

.



Relevant Pages

  • [ANN] Imagero Reader 1.79_96 released
    ... Imagero Reader is Java library for reading image files and reading/writing ... - JPEG inclusive CMYC and 12-bit grey ... metadata can be read. ... Imagero Reader works with java1.1 and later. ...
    (comp.lang.java.announce)
  • Re: ByteArraySeekableStream ignores offset
    ... E.g. for BMP images the BufferedImage returned from ImageIO is null. ... operations for Java Advanced Imaging. ... supplied for the BMP, JPEG, JPEG 2000, PNG, PNM, Raw, TIFF, and WBMP ...
    (comp.lang.java.gui)
  • Re: help with image display gui
    ... them as jpeg can someone help me in understanding how to inport them ... I wouldn't repost the same request like this, you posted an identical request just before the weekend. ... Personally I don't see what doing this in Java buys you, If you really want to draw a GUI using JPEGs you might as well mock up the whole thing in photoshop. ... You can "skin" components with images but I've never tried that. ...
    (comp.lang.java.gui)
  • Re: Raw JPEG Data Size
    ... > not in its entirity). ... I am attempting to extract (just extract, ... Currently I detect the JPEG signature, ... http://uio.imagero.com Unified I/O for Java ...
    (sci.image.processing)