julianfperez
julianfperez

Reputation: 1744

Hide maximize/minimize and close buttons for a Matlab figure window

I have a figure window and I want to remove the maximize/minimize and close buttons of it. I can not use any type of Java containers (JWindow, JPanel, ...) because they are not allowed to be Matlab components' parents. I am thinking of using some Java removeComponent command o something like this (I do not know if it will work). However, when I try to look for that buttons inside the structure of components through jf handle, I do not find where they are kept. Here is my code:

fh = figure('Menu','none','Toolbar','none');
jf = get(handle(fh),'JavaFrame');
drawnow; 
jf.set,

Upvotes: 3

Views: 2881

Answers (2)

Doresoom
Doresoom

Reputation: 7448

The MATLAB File Exchange has WindowAPI, which does exactly what you're looking for.

Upvotes: 1

Andrey Rubshtein
Andrey Rubshtein

Reputation: 20915

You are using undocumented functionality. This means that even if it will work, it might break on next Matlab release.

The only documented way will be (unfortunately) using Java.

I mean a code like this:

import javax.swing.*;
import java.awt.*;
jp = JPanel();
%Do somehow removal of maximize buttons.

Upvotes: 1

Related Questions