All I am trying to do is add a picture to a JFrame
.
I am really confused and don\'t really understand... I have looked up every possible question on this s
The biggest issues I can see are...
JFrame
, but not actually using it...static
when not really required...Calling setVisible
before anything has actually begin added. In fact, generally trying to manipulate the frame properties before anything was added to it and after it was made visible...
public class Main {
public static void main(String[] args){
EventQueue.invokeLater(new Runnable() {
public void run() {
JFrame xF = new JFrame("xFrame");
xF.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
xF.add(new JLabel(new ImageIcon("/Clicker/xS/cow.png")));
xF.setResizable(false);
xF.setSize(WIDTH*SCALE,HEIGHT*SCALE);
xF.setLocationRelativeTo(null);
xF.setVisible(true);
}
}
}
}
But since you never actually described what problems you were having, these are all guesses...