I want to add a simple Circle progress bar in my Java GUI application, to let the user understand, that there some network/download application. So what I want is something like this:
And in the code:
waitingBar.start();
myLongOperation();
waitingBar.stop();
I found this solution, which should be good as the layout, but it doesn't work, because I got this problem:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: alpha value out of range at java.awt.AlphaComposite.(AlphaComposite.java:618) at java.awt.AlphaComposite.getInstance(AlphaComposite.java:683) at gui.WaitLayerUI.paint(WaitLayerUI.java:41)
I have the external class, which calls the method start(); before the longOperation(); and then execute stop();. The JFrame is initialized directly in the Main.
So my question is:
- Is there something very simple to obtain the circle bar appear and dissapear ?
- How Can I fix the problem I'm facing with that solution ?