How to get back red waitbar?

조회 수: 6 (최근 30일)
Thomas . 2014년 11월 12일
댓글: Dev-iL . 2015년 7월 8일
In 2014b the waitbar appearance changed from the cool red to an ugly green windows-style one (btw in help documentation it still says "A wait bar is a figure that displays what percentage of a calculation is complete as the calculation proceeds by progressively filling a bar with red from left to right." ).
How can i revert it back to red?

채택된 답변

Robert Cumming
Robert Cumming 2014년 11월 12일
I played around with the java this afternoon and got this to work:
hBar = waitbar ( 0, 'Please Wait....' );
% now use java to get to the progress bar
jFrame = get ( hBar, 'JavaFrame' ); % this will throw a warning
jFigPanel = jFrame.getFigurePanelContainer;
jContainer = jFigPanel.getComponent(0);
jPanel = jContainer.getComponent(0);
jProgressContainer = jPanel.getComponent(0);
% get the progress bar
jProgressBar = jProgressContainer.getComponent(0);
% update the progressbar details
jProgressBar.setBackground ( java.awt.Color.RED );
jProgressBar.setString(''); % set the text to be empty
% example of progress bar being updated:
for ii=0:0.02:1
  댓글 수: 3
Dev-iL 2015년 7월 8일
Nice trick! FYI, the following line has no effect:
jProgressBar.setBackground ( java.awt.Color.RED );

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Michael Haderlein
Michael Haderlein 2014년 11월 12일
I'm working with 2014a, but if they didn't change the entire waitbar, you should be able to modify the color this way:
h = waitbar(0,'Please wait...');
steps = 1000;
for step = 1:steps
waitbar(step / steps)
Warning: Don't run this code too often, it might cause headache ;-)
  댓글 수: 1
Guillaume 2014년 11월 12일
Unfortunately, it doesn't appear to work in 2014b
the child of the waitbar (an axis) does not have any children (that are exposed)

댓글을 달려면 로그인하십시오.


Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기



Community Treasure Hunt

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

Start Hunting!

Translated by