Can anyone tell me why (by giving me the code) to make the image Dots replace with JLabel Hi so Dots shows up. All I am getting right now is the words Hi.
public class Memory extends JPanel {
ImageIcon Dots = new ImageIcon("Dots.jpg");
private JLabel Hi = new JLabel("Hi");
//ImageIcon Dots = new ImageIcon(this.getClass().getResource("Dots.jpg"));
Memory(){
Hi.setIcon(Dots);
Hi.setPreferredSize(new Dimension(100,100));
this.add(Hi);
}
}