I wrote a simple drawing program, and for to create a menu, I used this source, http://download.oracle.com/javase/tutorial/displayCode.html?code=http://download.oracle.com/javase/tutorial/uiswing/examples/components/MenuLookDemoProject/src/components/MenuLookDemo.java
Therefore in my program to show the menus, I only added these lines:
MenuDemo demo = new MenuDemo();
frame.setJMenuBar(demo.createMenuBar());
When I started the program, menu successfully works, but on the other hand, for example, when I click sth on menu, in method "actionPerformed" I want to change my program's boolean variable. But "actionPerformed" is exist in "MenuLookDemo.java", therefore I cannot reach the variables.
Can you suggest a solution please ?
Thanks