I tried to add an jpg image file into my Java Swing page, but when running, system always back error "Source not found" and stucking there. the source code are following
this.setLayout( new BorderLayout( ) );
URL url = getClass().getResource("logo");
ImageIcon imageicon = new ImageIcon( url );
JLabel label = new JLabel( imageicon );
this.add( label, BorderLayout.NORTH );
The file name is: "unStudent.java", and image file is "logo". I have put the both files in the same folder, why system can not find image file? what should I change?
Thanks in advance. Tony