title: JLabel not showing up on JPanel
body: <p>For some reason even though I have implemented the validate method in my code, and added my JPanel to my JFrame. I am also trying to get my JLabel to have Comic Sans font and for it to be centered in the screen. Why is my JLabel not showing up on my JPane</p>
  
  <pre><code>package math_program;
  
  import java.awt.Color;
  import java.awt.Font;
  import java.util.Random;
  import javax.swing.*;
  import static javax.swing.JFrame.EXIT_ON_CLOSE;
  
  public class Canvas 
  {
      Images obj = new Images();
  
      public void paintFrame()
      {
          //Instantiation of objects
          Random gen = new Random();
          JFrame frame = new JFrame();
          JPanel panel = new JPanel();
  
          //Text
          JLabel problem = new JLabel();
  
          frame.setVisible(true);
          frame.setAlwaysOnTop(true);
          frame.setResizable(false);
          frame.setDefaultCloseOperation(EXIT_ON_CLOSE); //Make frame actually closeable
          frame.setTitle("Math Owl: Alpha V:0.1 (coded by John)");
          frame.setSize(800, 500);
          frame.setLocationRelativeTo(null);
          frame.add(panel); //Add JPanel to JFrame
          panel.setVisible(true);
          panel.setLayout(null);
          panel.setBackground(Color.WHITE); //To see if text is even appearing
  
          //Adding Components
          problem.setFont(new Font("Comic Sans MS", Font.PLAIN, 20));
          problem.setLocation(400,250);
          problem.setText(gen.nextInt(11) + " + " + gen.nextInt(11));
          panel.add(problem);
          panel.validate();
  
      }
  
  }
  </code></pre>