The Java Programming Language:
Multimedia: Images, Animation and Audio
Random facts to remember when dealing with Multimedia in Java
If you want to access a "resource" file like an image file
from a jar file, as part of the display of your GUI, use
getResource with the class that needs the file, in a
statement analogous to this one:
ImageIcon redBall = new ImageIcon(MyView.class.getResource("red-ball.gif"));
When accessing files the forward slash (/) can be used
as a "universal" directory separator, another instance
of cross-platform nature of Java. In other words, you
do not need to use the double backslashes (\\) to separate
directories in Java code when writing for a Windows platform
(when providing a path to a file for getResource,
for example).