set command in matlab and java object

2 visualizaciones (últimos 30 días)
Orestis Koskoletos
Orestis Koskoletos el 8 de Mayo de 2016
Editada: Orestis Koskoletos el 8 de Mayo de 2016
I have a piece of code which runs a GUI in Matlab. And this particular command line:
set(jPb,'StringPainted','on','Value',0,'Indeterminate','off');
brings up this error:
Warning: Possible deprecated use of set('StringPainted','on') on Java boolean property: use jobj.setStringpainted(true) instead.
Warning: Possible deprecated use of set('Indeterminate','off') on Java boolean property: use jobj.setIndeterminate(false)
instead.
Anyone how to implement this solution? Thank you.

Respuestas (1)

Image Analyst
Image Analyst el 8 de Mayo de 2016
Did you finish reading the warning messages? They tell you what to do:
use jobj.setStringpainted(true) instead.
use jobj.setIndeterminate(false)
  1 comentario
Orestis Koskoletos
Orestis Koskoletos el 8 de Mayo de 2016
Editada: Orestis Koskoletos el 8 de Mayo de 2016
I did. I tried that but then an unknown command error shows up.
Part of the original code.
%--- Initialize java progress bar
global hPb
global jPb
jPb = javax.swing.JProgressBar;
set(jPb,'StringPainted','on','Value',0,'Indeterminate','off');
[hPb, hContainer] = javacomponent(jPb,[325 20 210 15],gcf);

Iniciar sesión para comentar.

Categorías

Más información sobre Call Java from MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by