Article View: borland.public.jbuilder.java.language
Article #540How to load images into the code ...
From: Magnus
Date: Thu, 30 Jun 2005 16:42
Date: Thu, 30 Jun 2005 16:42
31 lines
1747 bytes
1747 bytes
Hi,
I have downloaded and start to test a PrinterFrameowrk set of classes
that I found on JavaWorld.
In the PFPrintPreview class the image was loaded as:
firstPage.setIcon (new ImageIcon (getClass ().getResource
("images/FirstPage.gif")));
I added the directory "images" and put the gifs there.
But JBuilder could not find the images.
I then tried the method that worked on earlier use:
firstPage.setIcon (new ImageIcon
(printerframework.PFPrintPreview.class.getResource ("FirstPage.gif")));
How come that it didn't found them on the top code?
Dir structure
G:\jbproject\PrinterFrameWork\
G:\jbproject\PrinterFrameWork\bak
G:\jbproject\PrinterFrameWork\classes
G:\jbproject\PrinterFrameWork\src
G:\jbproject\PrinterFrameWork\src\images
G:\jbproject\PrinterFrameWork\src\printerframework
Magnus
Technical Details
Message-ID:
<42c420f7@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: f74b3,8cf3ca91ad1bd84d,start X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 30 Jun 2005 12:42:42 -0400 From: Magnus <magnus_bjorkman@iwon.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en, sv MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language Subject: How to load images into the code ... Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 71.0.99.107 Message-ID: <42c420f7@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1120149751 71.0.99.107 (30 Jun 2005 09:42:31 -0700) Lines: 31 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail