Using NetBeans to Develop a JavaFX Desktop Application
Add Created Nodes to Main.fx
The DeltaCars application is ready! However, nothing happens when you run it because the application nodes, DeltaTitleRect.fx, DeltaMenu.fx, DeltaCarLogo.fx, and DeltaAudioVideoPlayers.fx were not added to the Scene content. Therefore, the final version of Main.fx will look like this (notice how the MediaComponent is embedded in the scene):package deltacars; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.text.Text; import javafx.scene.text.Font; import javafx.scene.paint.Color; import com.sun.fxmediacomponent.*; import javafx.scene.Group; Stage { title: "Delta Cars" width: 712 height: 442 resizable: false scene: Scene { fill:Color.BLACK stylesheets: [ MediaComponent.css_skins ] content: [ DeltaAudioVideoPlayers.mediaBox,DeltaMenu{}, DeltaTitleRect{},DeltaCarLogo{}, DeltaAudioVideoPlayers{}] } }
Running the DeltaCars Application
There is no trick to running the DeltaCars application: just select the Run Main Project option from the Run main menu. The project will compile and you should see an explosion of effects, transitions, fades, and so on. When everything is settled, the application will look like Figure 1.As you have seen, NetBeans 6.5 for JavaFX 1.0 is an elegant method for developing JavaFX projects. In this article you learned how to develop such a project using the NetBeans support and various JavaFX classes.
Code Download
For Further Reading