In the constructor of my main window I create a button with the following simple code:
JButton jbOptions = new JButton("Options");
buttonsPanel.add(jbOptions);
jbOptions.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
new OptionsDialog();
}
});
Now, I need to pass to the constructor of the OptionsDialog a reference to the JFrame. How to do that? this is a reference to ActionListener.
MyJFramebeing the name of the enclosing class, obviously.