JButton showing up in the wrong spot after repaint is called
问题 I am trying to add a couple of JButton objects to my GUI program in Java and it is adding them to the JPanel (which is the main file of the program) but it is appearing in the incorrect spot. It is showing op at point [0, 0] and the action that is linked to it is happening at the correct spot. The rest of the elements on the panel are Images so the repaint method is called very often. private void init() { setLayout(null); setBackground(new Color(r, g, b)); addMouseListener(this);