Friday, September 2, 2016

Friday Fun XXXVIII

Hello again,

Today it's just a short blogpost about another little fun component that I've found on the web. In principle it's just a button that could be fun using it as a submit button. Here is what it looks like...



I thought that might be fun to implement in JavaFX and here you go...
In the implementation is room for improvement because the progressbar does not really reflect the progress it takes to download something. So if you would do it right, the progressbar would be updated dependent on the current process. Here it is simply part of the animation.
After the Java BBQ last weekend I've decided to add some of the mentioned improvements and now the behavior is as follows. You can click the button and after that it will wait for updating the progress (0.0 - 1.0). If the progress reaches 1.0 the checkmark will appear and the button return to it's start look.
I've added a method called setFailed() which will show a cross and change the button color to red before it will return to it's start look.
Nevertheless the component is fun and here is a little video that shows my version in action...



And like always the source is available on github.

That's it for today...so keep coding... :)

1 comment: