Tips & Tricks

­
17 07, 2014

JavaFX Tip 9: Do Not Mix Swing / JavaFX

By |July 17th, 2014|Java, JavaFX, Tips & Tricks|4 Comments

The JavaFX team has tried very hard to convince us that migrating from Swing to JavaFX is easy because of the option to embed Swing content in a JavaFX UI and vice versa. I must admit that I never tried it myself but based on the feedback I am getting from my customers I can [...]

14 07, 2014

JavaFX Tip 8: Beauty is Skin Deep

By |July 14th, 2014|FlexGantt, Java, JavaFX, Tips & Tricks|2 Comments

If you are developing a UI framework for JavaFX, then please make it a habit to always split your custom controls into a control class and a skin class. Coming from Swing myself this was not obvious to me right away. Swing also uses an MVC concept and delegates the actual component rendering to a [...]

11 07, 2014

JavaFX Tip 7: Use CSS Color Constants / Derive Colors

By |July 11th, 2014|FlexGantt, Java, JavaFX, Tips & Tricks|4 Comments

When working on FlexCalendarFX I got to the point where I had to define a set of colors to visualize the controls for different calendars in different colors. And not just one color per calendar but several: a background and a text color for deselected / selected / hover states. The  colors were used in several places [...]

11 07, 2014

JavaFX Tip 6: Use Transparent Colors

By |July 11th, 2014|FlexGantt, Java, JavaFX, Tips & Tricks|2 Comments

Picking the right colors for your user interface elements is always a great challenge, but it is even more challenging when you develop reusable framework controls where you as a developer have no control over the look and feel of the application using them. While you might always add elements on top of the default gray background [...]

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 [...]