plz help me out ...
i m using the following code to display an image which resides on my pc (C:\Users\vivek\Pictures\firefox,JPG)... but when i run the code ....there is no compile time error..n also not any run time error..n the output is a empty frame :'(
import java.awt.*;
import javax.swing.*;
class Display extends JPanel{
public void paintComponent(Graphics g){
Image image = new ImageIcon("firefox.JPG").getImage();
g.drawImage(image,3,4,this);
}
}
public class Daj {
public static void main(String[] args){
Display d=new Display();
JFrame frame = new JFrame("hi");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(d);
frame.setSize(910,572);
frame.setVisible(true);
}