I am trying to set an icon on a JFrame but when I run this code it does not change the icon at all.
JFrame frame = new JFrame("test gui");
frame.setBounds(0, 0, 500, 270);
frame.setIconImage(ImageIO.read(new File(PS_PROGRAM_DIR + "\\resources\\frame_icon.png")));
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setResizable(false);
frame.setLayout(null);
frame.setVisible(true);
I am not accessing a file within a class path btw.