Home » Tag Archives: JavaFX (page 3)

Tag Archives: JavaFX

JavaFX Tip 12: Define Icons in CSS

javafx-logo

When you are a UI developer coming from Swing like me then there is a good chance that you are still setting images / icons directly in your code. Most likely something like this:                 import javafx.scene.control.Label; import javafx.scene.image.ImageView; public class MyLabel extends Label { public MyLabel() { setGraphic(new ImageView(MyLabel.class. getResource("image.gif").toExternalForm())); } }   ...

Read More »

JavaFX Tip 11: Updating Read-Only Properties

javafx-logo

Custom controls often feature “read-only” properties. This means that they can not be set from outside the control, not even from their own skin class. It is often the behaviour of a control that leads to a change of the read-only property. In JavaFX this behaviour can be implemented in the control itself and in the skin. So we sometimes end up ...

Read More »

JavaFX Tip 10: Custom Composite Controls

javafx-logo

Writing custom controls in JavaFX is a simple and straight forward process. A control class is needed for controlling the state of the control (hence the name). A skin class is needed for the apperance of the control. And more often than not a CSS file for customizing the apperance. A common approach for controls is to hide the nodes they ...

Read More »

JavaFX Tip 9: Do Not Mix Swing / JavaFX

javafx-logo

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 only recommend to not mix ...

Read More »

JavaFX Tip 8: Beauty Is Skin Deep

javafx-logo

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 UI delegate, but people extending ...

Read More »

JavaFX Tip 7: Use CSS Color Constants / Derive Colors

javafx-logo

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 but for the sake of ...

Read More »

JavaFX Tip 6: Use Transparent Colors

javafx-logo

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 the developers embedding your controls  might have more ...

Read More »

JavaFX Tip 5: Be Observable

javafx-logo

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 observable. It usually required adding ...

Read More »

JavaFX Tip 4: Have The Final Word

javafx-logo

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 this:         ...

Read More »

JavaFX 8u20 Days of Future Past (Always On Top)

javafx-logo

It’s been a long time since I’ve posted topics relating to JavaFX. So, if you are still following along, awesome! Introduction In this blog post I want to blog about a very cool feature starting with JavaFX 8 update 20 that allows your application to always be on top of other applications. What this means is that on your desktop your ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close