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();

}

}

[1060 byte] By [hanzisrippeda] at [2007-10-2 12:58:07]
# 1
Normally you **** up and decorate frames/dialogs before you set themvisible. Otherwise you have to revalidate() them after you' ve addedsome components to them. (resizing them does that for you as you havenoticed).kind regards,Jos
JosAHa at 2007-7-13 10:16:01 > top of Java-index,Java Essentials,New To Java...
# 2
**** == poopkind regards,Jos
JosAHa at 2007-7-13 10:16:01 > top of Java-index,Java Essentials,New To Java...
# 3
Thanks I just put the setVisible(true) after all the items were added and set up. Works great now. Thank You!Hanz
hanzisrippeda at 2007-7-13 10:16:01 > top of Java-index,Java Essentials,New To Java...