ImageIO problems
Hi,
First let me say, I am new to Java. I am trying to write a little applet
for a web page that will do some special filtering on a graphic. In any
event, I am trying to load a graphic VIA ImageIO.read(), but keep getting
errors. Here is some sample code I wrote to test out ImageIO.read();:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.imageio.*;
import java.io.*;
import java.util.*;
public class GraphicTest extends Applet {
public void init() {
Image tileSheet = ImageIO.read(new File("blue.gif"));
}
public void paint(Graphics g) {
}
}
Ok, no big deal, really only one line that does anything... I get this
error:
GraphicTest.java:12: unreported exceptions java.io.IOException; must be
caught or declared to be thrown
Image tileSheet = ImageIO.read(new File("blue.gif");
^
That carrot should be under the ( before new.
Basically, I have been trying (hit or miss) various syntax to try to get
ImageIO to work... but nothing. I either get errors like this or that it is
an undefined symbol. If I copy examples strait out of books it seems not to
even work. Can anyone help?