Hello,
I am using Java Swing and I want to close a window on a button click. I don\'t know using an actionlistener as the best way to do this but currently I am having c
try this
//listener classes for the addItemFrame
class goBackListener implements ActionListener{
private addItemFrame frame;
public goBackListener(addItemFrame frame){
this.frame= frame;
}
public void actionPerformed(ActionEvent event){
frame.dispose();
}
}
and send an instance of addItemFrame
to it's constructor