
Which prints when executed
SwingButton [boundsInLocal=Rectangle2D [minX = 0.0, minY=0.0, maxX=34.0, maxY=10.0, width=34.0, height=10.0], boundsInParent=Rectangle2D [minX = 0.0, minY=0.0, maxX=34.0, maxY=10.0, width=34.0, height=10.0]
JComponentWrapper [boundsInLocal=Rectangle2D [minX = 0.0, minY=0.0, maxX=34.0, maxY=10.0, width=34.0, height=10.0], boundsInParent=Rectangle2D [minX = 0.0, minY=0.0, maxX=34.0, maxY=10.0, width=34.0, height=10.0]
JComponentWrapper [boundsInLocal=Rectangle2D [minX = 0.0, minY=0.0, maxX=34.0, maxY=10.0, width=34.0, height=10.0], boundsInParent=Rectangle2D [minX = 0.0, minY=0.0, maxX=34.0, maxY=10.0, width=34.0, height=10.0]
The first element is a javafx.ext.swing.SwingButton, JavaFX's native button based on Swing. The second one is a regular JButton wrapped by SwingComponent.wrap(), which is the solution to embedding any Swing component into a JavaFX scene. You may have noticed that the first button has an action property whose value is a Groovy closure but JavaFX knows nothing about them, however, it understands Function and in order to make things work a converter is being used under the covers. Now about the second component, the regular way to register event listeners on a JButton in SwingBuilder is used (because of the actionPerformed property) without being hindered by the fact that the component is actually another JavaFX class, again the builder knows how to route and convert attribute values as needed. Firing a click event in a programmatic way is a bit cumbersome as you can see, but it demonstrates that the button work as expected.
The builder is not yet capable of combining all the required elements to build a Stage/Scene combo, in other words a simple JavaFX application, hence the version number 0.1-ALPHA. It can be downloaded directly from the trunk at this location. Feedback is always appreaciated.
Keep on Groovying!