I just started Java GUI and I want to set a background image to JFrame by over-riding the paintComponent(Graphics g) method so that I will be able to add the child components over the image. I have looked at other answers but the code is too complicated for a beginner
Please use the following code to explain how this is done:
public class staffGUI extends JFrame {
public staffGUI(){
super("Staff Management");
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.setResizable(false);
this.pack();
}
}