MATLAB: How to get back red waitbar

MATLABmatlab gui

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?

Best Answer

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
jProgressBar.setStringPainted(true);
% example of progress bar being updated:
for ii=0:0.02:1
waitbar(ii,hBar)
pause(0.1)
end