Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / July 2005

Tip: Looking for answers? Try searching our database.

Java look'n'feel graphics repository in JApplet

Thread view: 
polsa - 15 Jul 2005 14:20 GMT
Hi all,
I have trouble loading the icons from the jlfgr-1_0.jar in my Applet
(works perfect for the JFrame). I have the following HTML:

<applet code="MyClass.class" archive="my.jar,jlfgr-1_0.jar"
codebase=".">
</applet>

And use the following code to load the icon

ImageIcon ico = new
ImageIcon(getClass().getResource("/toolbarButtonGrpahics/general/Cut24.gif"));

I get a NullPointerException using this Code. What's going wrong?

Thanks, Filip
Thomas Fritsch - 15 Jul 2005 14:56 GMT
> Hi all,
> I have trouble loading the icons from the jlfgr-1_0.jar in my Applet
[quoted text clipped - 8 lines]
> ImageIcon ico = new
> ImageIcon(getClass().getResource("/toolbarButtonGrpahics/general/Cut24.gif"));
..................................................Graphics... ???

> I get a NullPointerException using this Code. What's going wrong?
I assume it was the ImageIcon constructor who threw the
NullPointerException. (You should verify this assumption in the
exception trace you got in your browser's java console!)
Supposed that getResource("...") has returned null, because it didn't
find the gif.

> Thanks, Filip

Signature

"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.