Tips & Tricks

­
6 02, 2015

JavaFX Tip 17: Animated Workbench Layout with AnchorPane

By |February 6th, 2015|Java, JavaFX, Tips & Tricks|4 Comments

I recently had to implement a layout for an application where the menu area and the status area could be hidden or shown with a slide-in / slide-out animation based on whether the user was logged in or not. The following video shows the the layout in action: Update: a new video shows even [...]

17 11, 2014

JavaFX Tip 16: Undecorated & Transparent Stages

By |November 17th, 2014|JavaFX, Tips & Tricks|8 Comments

Last week I had some fun playing around with the "Undecorator" classes from Arnaud Nouard. I was looking into it because I was thinking about writing a JavaFX showcase application that integrates / lists the various resources available for JavaFX development. My goal for this application is to come up with something very slick and [...]

31 10, 2014

JavaFX Tip 15: ListView Autoscrolling

By |October 31st, 2014|JavaFX, Tips & Tricks|3 Comments

I recently had to implement autoscrolling functionality for FlexGanttFX and thought that my solution might be useful for others. You find the basic concepts of it in the listing below. The main idea is that a background thread is used to adjust the pixel location of the virtual flow node used by the list view. The [...]

13 10, 2014

New Custom Control: TaskProgressView

By |October 13th, 2014|ControlsFX, JavaFX, Tips & Tricks|9 Comments

I have written a new custom control and commited it to the ControlsFX project. It is a highly specialized control for showing a list of background tasks, their current status and progress. This is actually the first control I have written for ControlsFX just for the fun of it, meaning I do not have a [...]

19 08, 2014

JavaFX Tip 14: StackPane Children – Hidden But Not Gone

By |August 19th, 2014|JavaFX, Tips & Tricks|5 Comments

Another short tip: Swing provides a layout manager called CardLayout, which manages a set of components (cards) inside a container but always only shows one of them. The method CardLayout.show(Container, String) allows to switch between the components / the cards. The same behaviour can be accomplished in JavaFX by using the StackPane, adding several children [...]

19 08, 2014

JavaFX Tip 13: Study Modena CSS File

By |August 19th, 2014|JavaFX, Tips & Tricks|3 Comments

This is the easiest and shortest tip so far. If you want to do any of the following things: learn how to use CSS make your custom controls look like the standard controls reuse an SVG path graphic used by a standard control (e.g. scrollbar arrows) figure out how to navigate the structure of the standard [...]

22 07, 2014

JavaFX Tip 12: Define Icons in CSS

By |July 22nd, 2014|Java, JavaFX, Tips & Tricks|6 Comments

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())); } } In this [...]

18 07, 2014

JavaFX Tip 11: Updating Read-Only Properties

By |July 18th, 2014|JavaFX, Tips & Tricks|0 Comments

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

18 07, 2014

JavaFX Tip 10: Custom Composite Controls

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

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

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