fortunatly this code snippet is not as harmful at it seems to be.
As i unterstand the javacomponent function in above case it should create a certain java swing object placing it in a specific parent handle with postion p and returns the java handle and its hg container.
The way i thought it should work: 1. Create a figure object. 2. Create a java object (jTabbedPane) and place it in the figure object. 3. Create a java object (jPanel) and place it in the jTabbedPane object. 4. Create a java object (jLabel) and place it in the jPanel object. 5. Add the jPanel object to the jTabbedPane object. -> A tabbedPane with a single tab named like defined while creating the jPanel object is placed on the figure object.
This works fine! Unfortunately i missed to talk about the bigger problem:
--> How to place an uicontrol like an uipanel or axes to this java created tab? <--
My first intention was using the returned hg container handle while creating the java object with the javacomponent command and define this handle as parent handle for the specific object created with the common matlab coding commands. e.g. ... 6. matPanel = uipanel('parent',jPanelC,'units','normalized','position',[0 0 1 1],'BackgroundColor','white'); 7. myAxes = axes('parent',matPanel);
Returning neither warning nor error messages and indeed returning a valid handle to the uicontrol created object and even valid object itself, it does not appear on the parent handle.