Possible Duplicate:
“this” reference escaping during construction?
I would like to know whether leaking this in constructor issue is applied on this instance, since i believe the constructor has to invoke setJMenuBar() method to finish its construction, here is class implementation:
public class StaffManagerMainWindow extends JFrame implements ActionListener {
public StaffManagerMainWindow(String title, Image icon) throws HeadlessException {
...
setJMenuBar();
}
private void setJMenuBar() {
...
exitItem.addActionListener(this);
...
}
@Override
public void actionPerformed(ActionEvent e) {
throw new UnsupportedOperationException("Not supported yet.");
}
}