Tips & Tricks

10 07, 2014

JavaFX Tip 5: Be Observable

By |July 10th, 2014|FlexGantt, Java, JavaFX, Tips & Tricks|3 Comments

Even in this time of total NSA surveillance it is still a good idea to implement your JavaFX controls with observability in mind. This is easy to achieve in JavaFX especially compared to Swing. The Old Days Coming from Swing I was used to spending a lot of energy and time on making custom controls [...]

9 07, 2014

JavaFX Tip 4: Have the Final Word

By |July 9th, 2014|FlexGantt, Java, JavaFX, Tips & Tricks|8 Comments

When developing custom controls for JavaFX I would highly recommend to follow in the footsteps of  the core JavaFX controls and to make the API of your controls as final as possible and to put the "final" keyword in front of all your method declarations. Example In FlexGanttFX I have a lot of code that looks like [...]

15 04, 2014

JavaFX Tip 3: Use Callback Interface

By |April 15th, 2014|JavaFX, Tips & Tricks|2 Comments

As a UI framework developer it is part of my job to provide ways to customize the appearance and behavior of my controls. In many cases this is done by allowing the framework user to register a factory on a control. In the past I would have created a factory interface for this and provided one or [...]

10 04, 2014

JavaFX Tip 2: Sharp Drawing with Canvas API

By |April 10th, 2014|Java, JavaFX, Tips & Tricks|5 Comments

When I initially started out working with the Canvas API I noticed that the results of my rendering code were somewhat blurry and even worse, inconsistent. Some lines were blurry, others sharp. Coming from Swing it took me some time to realize that this was caused by the coordinate system of JavaFX, which allows for [...]

10 04, 2014

JavaFX Tip 1: Resizable Canvas

By |April 10th, 2014|Java, JavaFX, Tips & Tricks|18 Comments

While working on FlexGanttFX I had to deal a lot with the JavaFX Canvas node. I am using it to render activities on a timeline. Each row in the Gantt chart is a Canvas node. The user has the option to resize each row individually. So I had to figure out the best way to resize a [...]