Make an empty project and add two menu items.
In the constructor, add a
Code: Select all
System.out.println("Hello World!");
Compile, then "install and run in OpenOffice". As you open Writer, you will see "Hello World!" printed twice to the console.
If you add three menu items, you will see "Hello World!" printed three times to the console.
Then as soon as you click on the menu, you will see "Hello World!" printed three more times to the console.
Is this normal? If I want to prepare some interfaces (for example JFrames) inside my constructor so that they'll be readily available for my menu items, they'll basically be built as many times as I have menu items? Instead of building one JFrame I'll be building as many as I have menu items?