title: JButtons do not appear until MouseOver
body: <p>I'm trying to get JButtons which have been added to a JPanel to show up during the execution of a program, however they only appear when I hover the mouse of them, they remain invisible until then.</p>
  
  <p>Below is my code, I've tried repaint() and revalidate() with no luck.</p>
  
  <p>There also seems to be an issue with the height of the JPanel, it seems to be larger than the main Window for some reason</p>
  
  <pre><code>import java.awt.Color;
  import java.awt.Graphics;
  import java.awt.GridLayout;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import javax.swing.*;
  
  
  public final class SideMenu extends JPanel implements ActionListener{
      private final int width;
      private final int height;
  
      public SideMenu(int width, int height){        
          this.width = width;
          this.height = height;
          this.setLayout(new GridLayout(0,1));
          this.add(new JButton("button1"));
          this.add(new JButton("button2"));
          this.add(new JButton("button3"));
          this.revalidate();
          this.repaint(); 
      }
  
      @Override
      public void paint(Graphics g) {
          super.paintComponent(g);
          g.setColor(Color.black);
          g.fillRect(0, 0, width, height);
      }
  
  
      @Override
      public void actionPerformed(ActionEvent e) {        
          repaint();  
      }
  
      public static void main(String[] args){
          int width = 300, height = 400;
  
          JFrame jf = new JFrame();
          jf.setTitle("Fish Tank");
          jf.setSize(width, height);
          jf.setVisible(true);
          jf.setLayout(null);
          jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          ///jf.setResizable(false);
  
          SideMenu side_menu = new SideMenu(100,height);        
          jf.add(side_menu);
          side_menu.setBounds(200, 0, 100, height);
      }
  }
  </code></pre>