I am having this weird problem. My professor can't seem to duplicate it and the help he offers is minimal at best. So to the point. This code produces a JButton on a panel and adds to the Content Pane of the JFrame:

```
public myPanel extends JPanel {
    static final long serialVersionUID = 1;
    public myPanel() {
        this.setPreferredSize(new Dimension(600, 40));
    }
    public void paintComponent(Graphics graphicsDrawer) {
        super.paintComponent(graphicsDrawer);
        this.add(new JButton("A Button"));
    }
}

```

Here is the GUI code

```
public class myGUI {
    public myGUI() {
    }
    public void showGUI() {
        JFrame frame = new JFrame("Issues!!!");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(new myPanel());
        frame.pack();
        frame.setVisible(true);
    }
}

```

The GUI is then run by this class

```
// It is unnecessary to show here but I made a class that
// implements runnable that creates a myGUI object and calls
// showGUI
public static void main(String[] args) {
    RunnableGUI runGUI = new RunnableGUI();
    javax.swing.SwingUtilities.invokeLater(runGUI);
}

```

This is my code at **bare** minimum. However I have isolated this and the issue still persists even with the bare essentials. Below is a photo I am having the issue with.

[Initial Frame w/ 1 button](http://i.imgur.com/INVoHyN.png)

[Vertical Re-size creates extra buttons](http://i.imgur.com/tDwu1Wg.png)

I have tried literally everything I could find and think of.

I think the frame repaints the button each time it is re-sized. However the frame must be able to be re-sized because of the assignment requirements.

Running Windows 8 w/ JRE 7, 8 (I will download 6 but I do not think that will help)