View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Figures-menu adaption for standalone applications

4.0 | 1 rating Rate this file 3 Downloads (last 30 days) File Size: 5.76 KB File ID: #39026 Version: 1.2

Figures-menu adaption for standalone applications



12 Nov 2012 (Updated )

Create dockable figures for standalones and disable or remove menu items from the figures container

| Watch this File

File Information

As pointed out by Yair Altman in his very popular blog (, accessing the java properties of a figure window allows for making figures being dockable even in standalone applications. Unfortunately, the figures container contains menu items (Plot Browser, Figure Palette and Property Editor) which directly lead to crashes of the whole application.

To overcome this shortcoming, a function is supplied which removes the problematic (or unwanted) menu entries from the figures container. This is achieved by using a property change listener for the docking state of the figure. For this purpose, a figure creation functions is used for setting the listener as well as all other properties of the figure.

Additionally, a short test case is provided.

MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
27 Mar 2014 Thierry Dalon

Instead of DTDocumentBar = javaObjectEDT(figures_frame.getRootPane.getLayeredPane.getComponent(1).getComponent(1).getComponent(0).getComponent(0).getComponent(1).getComponent(0));
one could use the great findjobj:
or for Matlab >=R2012a:

JMenuBar.updateUI shall be added to refresh the menus.

Comment only
15 Nov 2012 Alexander Mering

Thanks Aurelien.
The main praise should go to Yair Altman how showed the route. I just discovered and removed the crashing items.

About the error: I extracted the functions from a larger project and forgot to rename the MousePressed Callback in the Callback_DockingFcn.

I made an update and changed
Cbrake_Callback_Diagrams_DockingFcn -> Callback_DockingFcn

Comment only
15 Nov 2012 Aurelien Queffurust

Nice submission . Starting the desktop from a deployead application is amazing!!).
Under R2012b , Windows XP in deployed mode , I get only once this error :
Undefined function or variable 'Cbrake_Callback_Diagrams_DockingFcn'.
Error in Callback_DockingFcn/@(source,event)Cbrake_Callback_Diagrams_DockingFcn

but if works as expected , I mean ... figures can be docked in deployed mode.

15 Nov 2012 1.2

Removed an error from the MousePressed_Callback for the DTDocumentBarButtons

Contact us