If not yet done, install Scene Builder 1.1.
From NB 7.4RC1, create a new FXML Application project and specify to use a JDK7u40 platform, if it's not the default JavaFX platform already.
Open the FXML document from NB to invoke Scene Builder 1.1. In SB window, add a new Button, specify "button1" for the fx:id property, set the onAction to "HandleButton1Action", and save the FXML file.
Back in NB, go into edit mode for the FXMLDocument.fxml file, select "Source > Make Controller" from the NB main menu.
The fx:controller="javafxapplication3.FXMLDocumentController" property is then duplicated.
This prevent this fxml file to be loaded in SB.
If I'm understanding this correctly, when you create a JavaFX FXML project, an FXML file (FXMLDocument.fxml) is created along with a corresponding Controller file, and a reference to the Controller is stored in the FXML file, for example like
Once you make ANY change to the FXML file using Scene Builder and save it, clicking "Make Controller" causes another reference to FXMLDocumentController.javafx:controller="javafxapplication19.FXMLDocumentController" to be inserted into the FXML file, rendering it incapable of being loaded in Scene Builder.
There are alternative scenarios that could cause this to happen as well.
I believe this anomaly is due to the fact that the new Scene Builder updates the xmlns:fx namespace with version information (xmlns:fx="http://javafx.com/fxml/1"), which is not properly recognized by NetBeans, and hence the existence of an existing controller is NOT detected and so NetBeans will insert as many duplicates as you like of references to FXMLDocumentController.javafx:controller="javafxapplication19.FXMLDocumentController"
AFAICT, If the namespace xmlns:fx="http://javafx.com/fxml/1" had been properly recognized, this bug would not arise, because NetBeans would not make the duplicate controller. PLEASE see Bug 236509
Thanks for the quick update.
Yes, you understood the issue well.
Any chance we get this fixed soon ? I mean in the next 7.4 update ?
Created attachment 140708 [details]
Confirmed, with patch to issue #236509 the Make controller does not duplicate the attribute; NB correctly finds the attribute and navigates to the existing controller class.
Is blocked until bug 236509 fix becomes a 7.4 patch.
*** Bug 236624 has been marked as a duplicate of this bug. ***
The underlying change transplanted to 74 (see issue #236509). Please verify
Verified Fixed in NetBeans 7.4-patch1