Azzera filtri
Azzera filtri

How can i solve set problem?

1 visualizzazione (ultimi 30 giorni)
Martí Pons
Martí Pons il 6 Dic 2017
Commentato: Martí Pons il 8 Dic 2017
jPb = javax.swing.JProgressBar; set(jPb,'StringPainted','on','Value',0,'Indeterminate','off','Foreground',[0 0 1]);
StatusBar(1)=uicontrol('Style','Text','Position',[.03*scrsz(3),.51*scrsz(4) .3*scrsz(3)15],'String','','BackgroundColor','w');
[SB1, ~] = javacomponent(jPb,[.03*scrsz(3) .48*scrsz(4) .3*scrsz(3) 20],F1);
% StatusBar2 - Pitch progression
jPb = javax.swing.JProgressBar; set(jPb,'StringPainted','on','Value',0,'Indeterminate','off','Foreground',[0 0 1]);
StatusBar(2)=uicontrol('Style','Text','Position',[.03*scrsz(3),.46*scrsz(4) .3*scrsz(3) 15],'String','','BackgroundColor','w');
[SB2, ~] = javacomponent(jPb,[.03*scrsz(3) .43*scrsz(4) .3*scrsz(3) 20],F1);
And the error is:
Error using set Parameter must be scalar.
Error in GenDesign/UserInterface (line 95) jPb = javax.swing.JProgressBar; set(jPb,'StringPainted','on','Value',0,'Indeterminate','off','Foreground',[0 0 1]);

Risposte (1)

Elizabeth Reese
Elizabeth Reese il 8 Dic 2017
The javacomponent function is undocumented and will change in a future release. I do not recommend using it.
With regard to the error, this is because the types for your inputs do not match what that Java object is expecting. It expects a boolean, int, boolean, and Color respectively.
set(jPb,'StringPainted',1,'Value',0,'Indeterminate',0,'Foreground',java.awt.Color(0,0,1));
  1 Commento
Martí Pons
Martí Pons il 8 Dic 2017
Seriously, you've saved my life. Thank you very much Liz!!

Accedi per commentare.

Categorie

Scopri di più su Software Development Tools in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by