@@ -262,8 +262,6 @@ public void windowActivated(WindowEvent e) {
262
262
// added for 1.0.5
263
263
// http://dev.processing.org/bugs/show_bug.cgi?id=1260
264
264
public void windowDeactivated (WindowEvent e ) {
265
- fileMenu .remove (sketchbookMenu );
266
- fileMenu .remove (examplesMenu );
267
265
List <Component > toolsMenuItemsToRemove = new LinkedList <>();
268
266
for (Component menuItem : toolsMenu .getMenuComponents ()) {
269
267
if (menuItem instanceof JComponent ) {
@@ -504,11 +502,11 @@ private void buildMenuBar() {
504
502
fileMenu .addMenuListener (new StubMenuListener () {
505
503
@ Override
506
504
public void menuSelected (MenuEvent e ) {
507
- List <Component > components = Arrays .asList (fileMenu .getComponents ());
505
+ List <Component > components = Arrays .asList (fileMenu .getMenuComponents ());
508
506
if (!components .contains (sketchbookMenu )) {
509
507
fileMenu .insert (sketchbookMenu , 3 );
510
508
}
511
- if (!components .contains (sketchbookMenu )) {
509
+ if (!components .contains (examplesMenu )) {
512
510
fileMenu .insert (examplesMenu , 4 );
513
511
}
514
512
fileMenu .revalidate ();
@@ -537,7 +535,7 @@ public void menuSelected(MenuEvent e) {
537
535
toolsMenu .addMenuListener (new StubMenuListener () {
538
536
@ Override
539
537
public void menuSelected (MenuEvent e ) {
540
- List <Component > components = Arrays .asList (toolsMenu .getComponents ());
538
+ List <Component > components = Arrays .asList (toolsMenu .getMenuComponents ());
541
539
int offset = 0 ;
542
540
for (JMenu menu : base .getBoardsCustomMenus ()) {
543
541
if (!components .contains (menu )) {
0 commit comments