Invisible objects because repaint method - Java Swing
问题 The problem comes because I overwrite the paintComponent method of a jPanel, so when I repaint all the objets are hidden till I focus them. I need to overwrite the paintComponent method cause it's the only one answer I'd found in internet to change the background image of a jFrame. So firstly I create a jPanel class: public class JPanelFondoPrincipal extends javax.swing.JPanel { public JPanelFondoPrincipal(){ this.setSize(800,500); } @Override public void paintComponent(Graphics g){ super