JMenu Bar does not show unless I resize the window
Hi, I have just a simple problem. I am trying to just have a blank JFrame with a JMenuBar at the top with the JMenu "File". I have the following code, but once I run the application it is just a blank frame with no Menus. Once I grab the frame and resize it with the mouse, it appears. What do I need to do to have the menu bar be shown once the application runs?
import javax.swing.*;
import java.awt.*;
class ProgramWindow extends JFrame
{
private JMenuBar jmb = new JMenuBar();
private JMenu file = new JMenu("File");
public ProgramWindow()
{
setSize(300, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
setJMenuBar(jmb);
jmb.add(fileMenu);
Container c = getContentPane();
c.setBackground(Color.lightGray);
c.setLayout(new BorderLayout());
setConentPane(c);
}
}
public class Program
{
public static void main (String[] args)
{
ProgramWindow pw = new ProgramWindow();
}
}

