Image won't appear in JLabel
问题 I've created GUI for my application using Netbeans' GUI Builder. I am trying to display a JFrame containing a JLabel with an image, and I can't get the Image to display. My generated code : private void initComponents() { //... jLabel1 = new JLabel(new ImageIcon(myPicture)); } And my class code: public class GUIWindow extends javax.swing.JFrame { BufferedImage myPicture; /** Creates new form GUIWindow */ public GUIWindow() throws IOException { myPicture = ImageIO.read(new File("images/logo