Article View: borland.public.jbuilder.java.language
Article #17907Re: Newbie Q - setImageName?
From: Martin Fuente
Date: Fri, 18 Sep 1998 00:00
Date: Fri, 18 Sep 1998 00:00
51 lines
1802 bytes
1802 bytes
Hello, my name is Martin.
You have one problems here because you use the setImageName method, and that
method throw an exception. So you must put this method in a try-catch block.
So, i understand that this code run good.
import java.io.* // Because you catch an IOException class which
is in java.io package
void img_Btn1_Music_mouseEntered(MouseEvent e) {
try
img_Btn1_Music.setImageName("C:\\jbuilder2\\myprojects\\RKLWebSite\\MusicDn.
gif");
}
catch (IOException e) {
System.out.println("Error when load the image");
}
}
Good luck.
leahey escribi๏ฟฝ en mensaje <6spkve$m8414@forums.borland.com>...
>Hello, I'm a Delphi programmer trying JBuilder/Java for the first time and
>fooling about with a little applet.
>To say I don't know Java is an understatement.
>I want to change the image of a TransparentImage control in the
mouseEntered
>event.
>
>What is wrong with this code?
>
> void img_Btn1_Music_mouseEntered(MouseEvent e)
> {
>
>img_Btn1_Music.setImageName("C:\\jbuilder2\\myprojects\\RKLWebSite\\MusicDn
.
>gif");
> }
>
>When I try to compile I get: "unreported exception: java.io.IOException;
>must be caught or declared to be thrown"
>
>JBuilder's "help" leaves a little to be desired on this topic.
>
>Thanks,
>leahey
>
>
Technical Details
Message-ID:
<6tun0j$br47@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6spkve$m8414@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f74b3,b2f1cea34d179d0d X-Google-Attributes: gidf74b3,public From: "Martin Fuente" <sistemas@gbreuer.com.ar> Subject: Re: Newbie Q - setImageName? Date: 1998/09/18 Message-ID: <6tun0j$br47@forums.borland.com> X-Deja-AN: 392557603 References: <6spkve$m8414@forums.borland.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: G. Breuer Newsgroups: borland.public.jbuilder.java.language