views:

355

answers:

3
+1  Q: 

Java: JProgressBar

Hi,

Is it possible to make a progressbar in Java like displayed on this page? Image.
So, not the default progressbar "filling-way".

If so, how?

Thanks

A: 

You'd have to do some wicked overriding of either the paint or paintComponent methods (I forget which one exactly), but yeah it's possible. The best way is to look at existing tutorials on custom swing components: http://today.java.net/pub/a/today/2007/02/22/how-to-write-custom-swing-component.html

They're pretty old, but still applicable.

Malaxeur
A: 

I think the easiest way would be to write your own custom component. The alternative would be a custom look and feel (there's a lot of work involved in that), but it shouldn't be too difficult to write a custom component with your own indeterminate animation very similar to what you see there.

jsight
If your goal isn't the specific look, but just a generic indeterminate progress bar, more help is available here: http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
jsight
+5  A: 

I found it self. Just call setIndeterminate(true);!!
I found it on java2s

Martijn Courteaux