Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Including images and other resources into .Jar File - rather urgent

0 views
Skip to first unread message

Jason T. Slack

unread,
Mar 12, 2002, 8:41:25 PM3/12/02
to

Hi,

I have been writing a Java App for a while now. I was using Jbuilder, but
want to give GW a try. I am using CW 7.

Is there a way that I can have CW include my images in my jar file
automatically? What about JDBC drivers like classes12.zip (oracle)?

What worked fine under Jbuilder throws a NullPointer exception when fetching
images under CW 7.

Here is the error:

Uncaught error fetching image:
java.lang.NullPointerException
at
sun.awt.image.URLImageSource.getConnection(URLImageSource.java:102)
at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:111)
at
sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:251
)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:217)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:185)

Here is example code of how I am fetching images:

URL url = SplashWindow.class.getResource("ml_banner.jpg");
Image img=Toolkit.getDefaultToolkit().getImage(url);
JLabel graphic = new JLabel(new ImageIcon(img));

Also, I am having an issue where I cannot open/edit ant files when they are
in the project window. I tried double clicking on a fie to edit and nothing
happens.

Any thoughts are appreciated. I think that I am going to re-install
codewarrior.

-Jason

0 new messages