From: Yair Altman on
"Matt Fig" <spamanon(a)yahoo.com> wrote in message <hssqqc$j1r$1(a)fred.mathworks.com>...
> Yair, I tried to run your example and it failed with the error:
>
> ??? Java exception occurred:
> java.lang.ArrayIndexOutOfBoundsException: No such child: 4
>
> at java.awt.Container.getComponent(Unknown Source)
>
> at javax.swing.JMenu.getMenuComponent(Unknown Source)
>
>
> Is this due to my using 2007b? I tried looking at other (lower) indexes and the same error occurs. Thanks.

It only works after opening the File menu. This can be done interactively or programmatically:

jFileMenu.doClick; % open the File Menu
jFileMenu.doClick; % close the menu

Yair Altman
http://UndocumentedMatlab.com