Estou tentando rodar este programa que faz aparecer uma imagem na tela porem esta dando esta mensagem de erro? alguem pode me ajudar
Exception in thread “main” java.lang.RuntimeException: Uncompilable source code - cannot find symbol
symbol: class URL
location: class estudo.Estudo
at estudo.Estudo.main(Estudo.java:32)
Java Result: 1
/*
- To change this template, choose Tools | Templates
- and open the template in the editor.
*/
package estudo;
import java.awt.*;
import java.awt.GridLayout;
import java.awt.Container;
import javax.swing.JFrame;
import java.io.BufferedInputStream;
import javax.swing.JLabel;
import java.net.URISyntaxException;
import java.lang.RuntimeException;
public class Estudo {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
JFrame f = new JFrame();
Container c = f.getContentPane();
c.setLayout(new GridLayout(1, 1));
URL imgsrc = Estudo.class.getResourceAsStream("tomcat.gif");
JLabel a = new JLabel("<html><b>" + imgsrc + "</b><br><img src='" + imgsrc + "'/></html>");
a.setHorizontalAlignment(JLabel.CENTER);
c.add(a);
f.setSize(300,400);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
}