10 Скомпилируйте и запустите приложение
This chapter steps you through using NetBeans IDE or the Apache Ant utility to compile and run the IssueTrackingLite application for which you build the FXML layout using JavaFX Scene Builder.
Use either of the sections below to see the IssueTrackingLite application in action.
Use NetBeans IDE
Use NetBeans IDE to build and run the NetBeans project in which you saved the IssueTracking.fxml file.
-
In the NetBeans IDE 8 window, right-click the IssueTrackingLite project node in the Projects window and select Run. NetBeans IDE compiles the project and if no errors are encountered, it displays an application similar to Figure 10-1. Click the image to enlarge it.
-
In the list view on the left, select Project1 and in the table view on the right, select the row with the TT-2 in the Name column. Data is displayed in the details section, as shown in Figure 10-1.
-
If you encounter any errors, look at the Output window and determine the possible causes of the errors. Some troubleshooting ideas are as follows:
-
Check that all of the fx:id values were entered correctly. The fx:id values in the FXML layout must match the values that the controller source classes expect.
-
Check that you entered the method name correctly in the Event binding section.
-
Use the Apache Ant Utility
If you choose not to run the application in NetBeans IDE, use the Apache Ant utility (version 1.8 or later) to build and run the application on the command line. Enter a command similar to the one in Example 10-1. Note that the examples shown use JDK 8.
In the above example, the main values for <TARGET> are clean
, jar
, and run
. For example, to run the IssueTrackingLite application on the Windows or Mac OS platform, enter something similar to the command in Example 10-2. You can set <TARGET> with the value of -projecthelp
to get a list of available targets.
Предыдущая | Следующая |