My JMenuBar is not showing up when i run my App. How can I fix this??
So when I run my JFrame I need to see my JMenuBar on top.
my Layout is Null
Code:
package view;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.WindowConstants;
public class Home extends JFrame {
private Container window = getContentPane();
public Home(){
initGUI();
}
public void initGUI(){
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setPreferredSize(new Dimension(800, 600));
setLayout(null);
JMenuBar menu = new JMenuBar();
JMenu file = new JMenu("File");
menu.add(file);
window.add(menu);
pack();
}
}