Hello,
I am having some trouble with getting my menu to respond to a mouse click.I have 2 items on my menu, "New" and "Exit", and they are using the actionlistner like so
newFromMenu = new JMenuItem("New Screen");
newFromMenu.addActionListener(this);
and then my action event
public void actionPerformed(ActionEvent e){
if(e.getSource() == newFromMenu ){
showPictures.setEnabled(true);
b1.setSelected(false);
b2.setSelected(false);
resetPanel();
panel = createPane();
setContentPane(mainPanel);
setVisible(true);
}
}
The code compiles fine, but when I try to run the program I am presented with an error and the Frame will not display.Is it obvious as to what I am doing wrong?
Thanks
Static.