Warm tip: This article is reproduced from stackoverflow.com, please click
java javafx fxml scenebuilder

Why .fxml file is not opening in Scene Builder?

发布于 2020-04-08 15:41:14

I have an issue while I open the abc.fxml file in Scene builder is shows this dialog box:

enter image description here

This is a abc.fxml code:

`<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXButton?>
<?import javafx.scene.layout.AnchorPane?>


<fx:root fx:id="w" prefHeight="400.0" prefWidth="400.0" type="AnchorPane" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.65">
   <children>
      <JFXButton fx:id="w1" layoutX="138.0" layoutY="243.0" />
      <JFXButton fx:id="w2" layoutX="256.0" layoutY="230.0" />
   </children>
</fx:root>`

These are the details that mentions in Show Details:

Show Details

Questioner
badarshahzad
Viewed
57
badarshahzad 2017-10-27 15:45

If you facing this problem then please check your FXML tags are correct as what I have above wrong that was this line

`<?xml version="1.0" encoding="UTF-8"?>

remove fire "`" from first line. Right click on fxml file and Open with Scene Builder. If you will get a pop again right click again and open again it will sure opened. But these days Scene Builder can be install separately and you can drag drop fxml in it.