So how do you translate a GIF, PNG, or JPEG file into something you can
display? This is done via Toolkit's getImage() method: It parses the
image file and returns an Image object. Here's an example:
Toolkit toolkit = Toolkit.getDefaultToolkit();
Image image = toolkit.getImage(fileName);
This code looks innocent enough, but it doesn't actually load the
image. The image begins loading in another thread. If you display the
image before it is finished loading, only part (or none) of the image
actually gets displayed.
You can use a MediaTracker object to watch the image and wait for it to
finish loading, but there is an easier solution. The ImageIcon class
loads an image using MediaTracker for you. The ImageIcon class in the
javax.swing package loads an image using the Toolkit and waits for it
to finish loading before it returns. For example:
ImageIcon icon = new ImageIcon(fileName);
Image image = icon.getImage();
E não esqueçam de dar uma lida no JMF. Parece que é fácil usar:
http://java.sun.com/products/java-media/jmf/1.0/guide/index.html
qual é o problema de demora?
fabio.
Abs,
Danilo