Friday, December 12, 2014

Friday Fun Component XXII

And another one...
Last weekend I took a closer look to the new Yotaphone 2 which in principle is just another Android mobile phone BUT it has a second screen on the backside. And this is not a standard screen, it's an e-paper display.
I really like the simplicity of the widgets that they use on the e-paper display and especially the clock looked good to me...
So I created a version in JavaFX and here it is...

As you can see this is a really simple clock but that's exactly what I like about it... :)
It has not many features, so one can update the time by calling updateTime() which will show the current time or you can update it with your own time with updateTime(LocalDateTime). In addition you can define the background and foreground color with setBackgroundColor(Color) and setForegroundColor(Color). And there is a method to invert the colors called setInvert(boolean) and that's it.
Like I said it has not many features but's just a simple clock :)

If you like it you can fork it on Bitbucket as always...

That's it for today...keep coding...


  1. Sleek!

    Just curious: Why didn't you use JavaFX Timeline for the updates?

    1. Because I would like to use the clock on an e-paper display I've tried different approaches to reduce the cpu utilization and ended up using a scheduled future to realize it. You can also use a timeline.

  2. Thanks. The simplicity makes it easy to see how you did it. Do you code the builders manually or is there a code generator for it?

    1. Everything is done generators involved :)

  3. I like the style and I'd like to create my own builders. However I've noticed that "builders" are deprecated in Java now. I also read this: So I'm confused. Is there a proper way / pattern to create builders?