Hi,
Just new to java...why is the image not displayed??
The image is the smae directory as the program.
Thanks in advance
eclipse33
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Image test"
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add( new JLabel( new ImageIcon("jersey.jpg" ) );
f.setSize(500,500); f.setVisible(true);
}
}
Just new to java...why is the image not displayed??
The image is the smae directory as the program.
Thanks in advance
eclipse33
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame f = new JFrame("Image test"
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add( new JLabel( new ImageIcon("jersey.jpg" ) );
f.setSize(500,500); f.setVisible(true);
}
}