GUIDE - Java component creates grey box in a certain position on the screen

5 views (last 30 days)
I have a very complicated gui, and I wanted to integrate some java components (to use the html feature and many more). The first time i used a java control i created a text input control:
javaHandle = javaObjectEDT('javax.swing.JTextField');
[handles.objTextbox, handles.hTextBox] = javacomponent(javaHandle);
set(handles.hTextBox, 'Parent', handles.panel1);
It worked great, nothing was wrong with it. After a while i wanted to add a static text control with html in it, so i created a java component:
javaHandle2 = javacomponent('javax.swing.JLabel');
[h1.obj, h1.h] = javacomponent(javaHandle2);
set(h1.h, 'Parent', handles.StatusBarTextPanel);
set(h1.h,'Position', [4 7 427 18]);
this line alone created a grey box in a certain position on the gui that cannot be moved. The component is normal, I can change it's text and position, but there still is that grey box in the gui. The first line (javaHandle2 = javacomponent) is the one causing the problem.
How can i solve this, and get rid of that grey box?
(the grey box, on the figure with a different color)
  1 Comment
Geoff Hayes
Geoff Hayes on 10 Apr 2016
Tor - without knowing more about your GUI and where the above code is being called or how the panels are arranged it will be difficult to provide a solution. Also, where is the grey box appearing - within one of the panels or somewhere else?

Sign in to comment.

Answers (0)


Find more on Migrate GUIDE Apps in Help Center and File Exchange



Community Treasure Hunt

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

Start Hunting!