Hi all
I was just trying to add and display an image on a Jwindow using the following code.
import javax.swing.*;
import java.awt.*;
public class splash
{
static Image i = Toolkit.getDefaultToolkit().getImage("image/splash.jpg");
public static void main(String args[]){
JWindow jw = new JWindow(){
public void paint(Graphics g){
g.drawImage(i,0,0,i.getWidth(this),i.getHeight(this),this);
}
};
jw.setSize(500,300);
jw.setVisible(true);
}
}
The Jwindiw is display but it is blank hence no image gets displayed in it.
Is there anything wrong with the code or it has some other technique of doing it?
please help
shyam