Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Testing Applet in Eclipse - Deletes Graphics and Sounds(When I finish testing my Java applet in Eclipse, it sometimes deletes the graphics and sound files)
Testing Applet in Eclipse - Deletes Graphics and Sounds [message #700225] Sat, 23 July 2011 02:54 Go to next message
haytil is currently offline haytilFriend
Messages: 1
Registered: July 2011
Junior Member
Hello,

I am relatively new to programming Java in Eclipse. I have been writing a Java Applet, which uses graphics files (.PNG) and sound files (.WAV). I want the Applet to download the graphics and sound files from the same directory on the server that the Applet itself is downloaded from. To that end, they are stored in "GFX" and "SFX" subdirectories along with the .class files on the server, and the Applet uses GetCodeBase() to find them.

Everything works fine when actually running the applet on the server. However, when testing the applet in Eclipse, I encounter difficulties.

I have copied over the "GFX" and "SFX" directories into the "bin" folder of my project in my workspace, so that way GetCodeBase() can reach them as normally from my local machine when testing in Eclipse. However, sometimes after I'm done (usually when I close Eclipse), the "GFX" and "SFX" directories are automatically deleted. This means I have to remember to copy over "GFX" and "SFX" into my "bin" folder the next time I run Eclipse, otherwise testing won't work as I won't be able to load in the graphics and sound effect files.

My understanding is that this is probably because applets will delete downloaded graphics and sound effects files that have been saved locally when the user is done with them - that way, they don't clutter the user's machine.

However, for the purposes of debugging, that behavior is obviously undesirable from Eclipse. How can I alter Eclipse so that it doesn't automatically delete these files and sub-directories after testing the applet - so that they'll be around the next time I want to test?

Thank you.
Re: Testing Applet in Eclipse - Deletes Graphics and Sounds [message #702565 is a reply to message #700225] Tue, 26 July 2011 14:16 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 23.07.2011 04:54, haytil wrote:
> Hello,
>
> I am relatively new to programming Java in Eclipse. I have been
> writing a Java Applet, which uses graphics files (.PNG) and sound
> files (.WAV). I want the Applet to download the graphics and sound
> files from the same directory on the server that the Applet itself is
> downloaded from. To that end, they are stored in "GFX" and "SFX"
> subdirectories along with the .class files on the server, and the
> Applet uses GetCodeBase() to find them.
>
> Everything works fine when actually running the applet on the server.
> However, when testing the applet in Eclipse, I encounter difficulties.
>
> I have copied over the "GFX" and "SFX" directories into the "bin"
> folder of my project in my workspace, so that way GetCodeBase() can
> reach them as normally from my local machine when testing in Eclipse.
> However, sometimes after I'm done (usually when I close Eclipse), the
> "GFX" and "SFX" directories are automatically deleted.
The 'bin' folder is the output folder owned by the Java compiler which
deletes its contents during a build. You should put the resources in a
separate folder (e.g. 'src'). Those resources will then be copied into
the 'bin' folder during build.

Dani
> This means I have to remember to copy over "GFX" and "SFX" into my
> "bin" folder the next time I run Eclipse, otherwise testing won't work
> as I won't be able to load in the graphics and sound effect files.
>
> My understanding is that this is probably because applets will delete
> downloaded graphics and sound effects files that have been saved
> locally when the user is done with them - that way, they don't clutter
> the user's machine.
>
> However, for the purposes of debugging, that behavior is obviously
> undesirable from Eclipse. How can I alter Eclipse so that it doesn't
> automatically delete these files and sub-directories after testing the
> applet - so that they'll be around the next time I want to test?
>
> Thank you.
Previous Topic:Eclips 3.5 to 3.7 under Linux?
Next Topic:Plugin/Bundle Help
Goto Forum:
  


Current Time: Thu Apr 25 12:05:22 GMT 2024

Powered by FUDForum. Page generated in 0.08327 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top