🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #9034

Re: Buttons icons in WinNT and Solaris

#9034
From: Greg Hamer
Date: Mon, 05 Jun 2000 00:00
71 lines
3517 bytes
Sounds like the image was not in the right place, or the source path/output
path was not correct on the Solaris machine. The designer tries to use the
RioGuiFrame.class.getResource("door01.gif") form for specifiing the image
file URL. It needs to find a nearby class file that is in the project in
order to do that though. If it cannot find a class file it generates the
ugly  URL
new
java.net.URL("file:////home/rita/Projects/RioControl/images/door01.gif")));
instead. Since it did so, that would mean that door01.gif is not in the same
directory as RioGuiFrame.class  anymore. (or the package name for
RioGuiFrame.class does not match the directory structure from the output
path).

Rita Barda <rita.barda@conexant.com> wrote in message
news:393B63F5.CDDAAD49@conexant.com...
> I have a little problem with project in WinNT and Solaris.
> The problem is with icons of buttons.
>
> At first, I created a project in WinNT, and added icons to buttons
> (added GIF files to the project and selected a needed file in the "icon"
> property) .
> The source line of the setting icon was like this:
>     btnExit.setIcon(new
> ImageIcon(RioGuiFrame.class.getResource("door01.gif")));
>
> Then, I copied the project to Solaris. And I could not nor view the
> icons on the buttons in the designer window, neither run the
> application.
> There were two following messages for each icon in the messages window:
>     java.lang.NullPointerException new
> ImageIcon((RioGuiFrame.class.getResource("door01.gif"))
>     Failed to create live value from new
> ImageIcon((RioGuiFrame.class.getResource("door01.gif"))
>
> I tried to set icon property to "none", remove a GIF file from the
> project, then add it and select it in the icon property.
> And the code line (that was added by JBuilder)
> was the same, with "getResource" method.
> And, of course, the problem was still there.
>
> So, I created a new project with new java files, and designed all frames
>
> from the beginning.
> Now, when I added icons to buttons, the source line was as following:
>     btnExit.setIcon(new ImageIcon(new
>
java.net.URL("file:////home/rita/Projects/RioControl/images/door01.gif")));
>
> And everyting was fine.
>
> I opened this project in WinNT, and here is the problem again:
> Windows don't know the path "file://home/rita", so I couldn't see any icon
on
>
> the buttons.
> When I added an icon anew, the source line was changed:
>     btnExit.setIcon(new ImageIcon(new
> java.net.URL("file:///H:/rita/Projects/RioControl/images/door01.gif")));
>
> (H: is the mapping drive of the Unix network).
>
> And here are my questions:
> 1. What is the solution of this problem?
> 2. Are there additional problems with JBuilder in NT and Solaris?
> Are there something that I should know to be able to edit and run
> the same project without problems in NT and Solaris?
>
> Any help will be appreciated,
> Rita Barda.
>
>
Technical Details
Message-ID: <8hgntl$ihu4@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <393B63F5.CDDAAD49@conexant.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,db85f3cc35399006
X-Google-Attributes: gid111d45,public
From: "Greg Hamer" <ghamer@corp.netzero.net>
Subject: Re: Buttons icons in WinNT and Solaris
Date: 2000/06/05
Message-ID: <8hgntl$ihu4@bornews.borland.com>
X-Deja-AN: 631370880
References: <393B63F5.CDDAAD49@conexant.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Newsgroups: borland.public.jbuilder.java.swing