Tips & Tricks

­
16 06, 2015

JavaFX Tip 20: A lot to show? Use Canvas!

By |June 16th, 2015|Java, JavaFX, Tips & Tricks|5 Comments

There seem to be two kinds of JavaFX applications: the first one is using a scene graph with nodes and CSS styling, and the second one is using a single canvas. However, it is perfectly legal to mix these two approaches. Especially when your application has to show a lot of detailed information where you would easily end up [...]

5 06, 2015

JavaFX Tip 19: Watch Your Skin

By |June 5th, 2015|Java, JavaFX, Tips & Tricks|4 Comments

A common mistake that I do over and over again is that I put certain code into the skin class of a custom control while it should have been inside the control class itself. I just noticed this again when going through the list of bugs filed for the PopOver control of ControlsFX. I contributed [...]

18 02, 2015

JavaFX Tip 18: Path Clipping

By |February 18th, 2015|ControlsFX, Java, JavaFX, Tips & Tricks|3 Comments

I recently noticed that the PopOver control, which I committed to the ControlsFX project, does not properly clip its content. It became obvious when I was working on the accordion popover for the FlexCalendarFX framework. Whenever the last titled pane was expanded the bottom corners were no longer rounded but square. After placing a red [...]

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