I would like to place an image on an extended JFrame to set it as background, the extended jframe contains menu bars only. The problem is that, it doesn't display the picture, I don't know what I might be doing wrong. Any ideas are highly appreciated
public class VirtualViewGUI extends JFrame{
public VirtualViewGUI()
{
super("Virtual View");
JMenuBar jmenuBar = new JMenuBar();
JMenu fileMenu = new JMenu("File");
JMenu helpMenu = new JMenu("Help");
JMenu feel = new JMenu("Look & Feel");
JMenu layOutMenu = new JMenu("ConfigureCells");
JMenuItem add_files = new JMenuItem("Select Directory..");
JMenuItem minCellSize = new JMenuItem("height 260 X width 260");
JMenuItem moderateCellSize = new JMenuItem("height 320 X width 320");
JMenuItem maxCellSize = new JMenuItem("height 360 X width 360");
JMenuItem exit = new JMenuItem("Exit");
JMenuItem help = new JMenuItem("Help Content");
fileMenu.add(add_files);
fileMenu.add(exit);
layOutMenu.add(minCellSize);
layOutMenu.add(moderateCellSize);
layOutMenu.add(maxCellSize);
helpMenu.add(help);
jmenuBar.add(fileMenu);
jmenuBar.add(layOutMenu);
jmenuBar.add(helpMenu);
ImageIcon myImage=new ImageIcon("grid_2.png");
JLabel icon = new JLabel(myImage);
icon.setIcon(myImage);
setJMenuBar(jmenuBar);
add(icon);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}