Friday, October 11, 2013

Friday Fun XVIII

Hi there,

Long time no post but I've been busy with JavaOne. Just let me give you a little advice...
Never submit more than 4 proposals to a conference...especially not if your computer harddrive crashes one day before JavaOne and you have a home :(

But now to some quick fun...because it's friday. I was looking for a control that I could use on my Raspberry Pi to control relays and I remembered the on/off switches in iOS. So I was looking around at dribbble and found template

This looked nice to me and I thought it might be a good example on how to modify an existing control so that it would look like the one at dribbble.
It seems the CheckBox is the optimal candidate for tweaking and so I took a look at the JDK8 sources and the Modena.css.

Again I was surprised how easy it is to tweak an existing control by playing around with the CSS file and the Skin. I did only spend around 45 min to create that control and did not test everything but if you need something special...fork the repo and do it yourself :)
Means this is really just a quick hack to check if this would work for me so for example it does not support resizing except you use setScaleX() and setScaleY().

The result looks like this...

and the code can be found 
Here is also a little video that shows the control in action.

That's it for today...enjoy your upcoming weekend...and keep coding...


  1. Hello there,
    I would like to report a bug in the notification project (javafx) !!
    When pressing the notify button, + the notification that popus up, there is another window that comes out that shouldn't, is there a way to a fix ??

    1. Hi Aymen,
      Yep, you are right, thanx for pointing me to that. The problem is fixed in the Enzo library.