import java.awt.*;
import java.awt.image.*;
import java.awt.geom.*;
import java.lang.Exception.*;
import java.io.*;
import javax.imageio.*;
import javax.imageio.ImageIO;
import java.net.*;
import java.net.MalformedURLException;
class Blur1
{
public static void main ( String [] args)
{
float[] matrix = {0.111f, 0.111f, 0.111f,
0.111f, 0.111f, 0.111f,
0.111f, 0.111f, 0.111f,
};
BufferedImage sourceImage = null;
try
{
URL url = new URL("image_0054.jpg");
}
catch(MalformedURLException me)
{
System.err.println("Malformed URL Exception" + me.getMessage());
}
sourceImage = ImageIO.read(url);
BufferedImage destImage = null;
BufferedImageOp op = new ConvolveOp( new Kernel(3, 3, matrix) );
BufferedImage blurredImage = op.filter(sourceImage, destImage);
}
}
When i compile the above code, i am getting the following error
blur1.java:27: cannot find symbol
symbol : variable url
location: class Blur1
sourceImage = ImageIO.read(url);
What might be the reason ?
Thanks in advance.