I wrote the following code:
JLabel lblNewLabel_1 = new JLabel("");
Image img= new ImageIcon(this.getClass().getResource("/timeplanner11.jpg")).getImage();
lblNewLabel_1.setIcon(new ImageIcon(img));
lblNewLabel_1.setBounds(0, 0, 28, 30);
panel.add(lblNewLabel_1);
It is showing the error:
ImageIcon cannot be resolved to a type
Can someone please help me in correcting this error?
Thank you!!!