I've been trying to add an image to a JFrame
but I can't seem to get it done.
I looked at online tutorials and other similar questions but nothing seems to work.
ImageIcon wiz = new ImageIcon("wizard.png");
ImageIcon assassin = new ImageIcon("assassin.png");
JFrame frame = new JFrame("Select");
frame.setBounds(50, 50,1000, 1000);
JButton w = new JButton("Wizard");
JButton a = new JButton("Assasin");
JFrame f = new JFrame("Image");
JLabel img1 = new JLabel(wiz);
frame.setLayout(null);
f.setLayout(null);
f.setIconImage(wiz.getImage());
w.setBounds(30,380,100,60);
frame.add(w);
a.setBounds(200, 380, 100, 60);
frame.add(a);
f.setVisible(true);
frame.setVisible(true);