This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 153683 [details] Sample application that demonstrates the issue Constants that are not the same type as the enclosing class' type are not considered as valid constants candidates and give the following error: "Constant 'ENTER_VALUE' is not defined for 'Constants'" A simple class with some constant fields: package netbeansfxmlconstantserror; public class Constants { public static final String EMPTY = ""; public static final String ENTER_VALUE = "Enter value"; } A simple fxml that tries to use the constant: <?xml version="1.0" encoding="UTF-8"?> <?import netbeansfxmlconstantserror.Constants?> <?import javafx.scene.control.Label?> <?import javafx.scene.layout.BorderPane?> <BorderPane xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:id="root"> <center> <Label><text><Constants fx:constant="ENTER_VALUE"/></text></Label> </center> </BorderPane> Browsing the netbeans code, I could see that a check is explicitly done to verify that the defined constant is of the same type of the enclosing class. http://hg.netbeans.org/main-golden/file/828c5a176b92/javafx2.editor/src/org/netbeans/modules/javafx2/editor/completion/beans/BeanModelBuilder.java#l772