I'm writing a Java applet and using Eclipse. What should the directory structure/build path/other configuration be so that I can use getResource() or ImageIcon with some relative path when running the applet in Eclipse's applet viewer? (I'll figure out later how to get it to work for when the applet is deployed.) Is some kind of project builder necessary?
Answer on In Eclipse, where do I save files to make them available to a Java Applet?
If you use getResource() the path should be relative to the source folder.
/src/
| -- resources
----| -- images
--------| -- img1.jpg
--------| -- img2.jpg
----| -- audio
| -- config
| -- org
----| -- music
--------| -- mp3
------------| -- decode
If I wanted to get the URL of img2.jpg:
URL imgURL = this.class.getResource(
"/resources/images/img2.jpg");
Langganan:
Posting Komentar (Atom)
Postingan Populer
-
Wallpapers: natural scenery(1) Wallpaper Collection: Sports Wallpaper ... Zinta Wallpapers 2nd Collection 2012 | Latest, Hot, Stylish Wallpa...
-
HobbyKing's 29% SBach 342 50cc Build. | James-My Life In R/C Flying karizma album frames photoshop background marriage album frames for ...
-
Bilal Ali Babber Kasur: Wallpapers of Shakira Pop Star One Shot WALLPAPER Angel eyes beautyfull glamour model and best pop queen wallpapers ...
-
Michael Myers membunuh kakak perempuannya dengan sadis saat ia masih ... Sadis Brutal Death Metal Sadis Dowh - Apple's Fashion When Appl...
-
Beautiful Girl Wallpaper ~ Spicy Wallpapers Email This BlogThis! Share to Twitter Share to Facebook ... Desktop Wallpapers l Download Wallpa...
-
how to draw : som Enciclopedia: Los Yokai ~ Subeteanime: Las comidas favoritas de Rukia son las bolas de arroz y los pepinos. Gallery | blea...
-
... can videos, zeynep videos, sibel can photos, zeynep photos, sibel can Sibel Kekilli - PicArena Image Match - Mavie Horbiger pictures, Si...
-
I'm in college and live on campus in a dorm. What are some easy, healthy, and inexpensive recipes I can make? I only have a microwave. I...
-
Windows XP SP3 Pro. 32bit EN-US - Black v2011.9.15 | NY-ShaDoW windows xp sp3 wallpaper - www.smscs.com windows xp sp3 original full - Ident...
-
Srs Wallpaper cool wallpapers sr 71 wallpapers blackbird wallpapers sr 71 blackbird ... best wallpaper desktop one IV |http://alldesktopwind...
0 Response to "In Eclipse, where do I save files to make them available to a Java Applet?"
Posting Komentar