MATLAB: Waitbar color, 2016a is broken red; how to set to older continuous green

MATLABwaitbar colorxyz

In 2016a waitbar had red color with discrete marks. Older version is continuous green bar.
How to set the waitbar to the old fashion?

Best Answer

waitbar() creates a figure. In R2016a (did not check other HG2 implementations), that figure has a hidden member in Children which is a JavaWrapper . That JavaWrapper has a JavaPeer which is a javax.swing.JProgressBar which is what is doing the real work. There is no foreground color property above that level.
I have difficulty chasing below that level as I am not very familiar with Java. On my system if I use getForeground on the JavaPeer then the result is java.awt.Color[r=255,g=0,b=0] which would be full red -- but in fact on my system, OS-X El Capitan, the actual color for my progress bars is blue. I can construct a new color and use setForeground on the JavaPeer but it makes no difference. If I use getGraphics on the JavaPeer, and getColor on the result of that, I get told java.awt.SystemColor[i=9] but I have not been able to figure out how the i=9 translates into colors. Meanwhile getBackground on the getGraphics replies with com.apple.laf.AquaImageFactory$SystemColorProxy[r=238,g=238,b=238] which is plausible for the background I observe.