How to make a java Jpanel as child of uiPanel or uifigure ?

6 views (last 30 days)
Hi all,
I have a java-Jpanel class using openGL and i would like to "insert" this java class in a matlab container like uiPanel or uifigure.
At the moment it works using javacomponent undocumented function :
Is there some possibilities to do something like that :
f = uifigure;
p=uipanel(f,'Position',[.25 .1 .67 .67],'Title','Main Panel');
p.Children=myJPanelObject; OR p.addChildren(myJPanelObject)
Alternatively, is it possible to add a uiPanel as a child of a JPanel ?
Thanks for your help
  1 Comment
Lama Itani
Lama Itani on 29 Jul 2021
Edited: Lama Itani on 29 Jul 2021
Hi Philippe,
not sure if I understood 100% what you are trying to achieve but I think there might be another workaround to this by creating a subpanel, let's say stored in variable subp, which considers variable p as a parent. In this way, sp will be the child of p.
f = figure;
p = uipanel(f,'Position',[.25 .1 .67 .67],'Title','Main Panel');
subp = uipanel('Parent',p,'Title','Subpanel','FontSize',10,...
'Position',[.4 .1 .5 .5]);

Sign in to comment.

Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!