3

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

badarshahzad
  • 1,227
  • 16
  • 25
  • your file has some error, you should to solve them so you can open it, you can show us your code – Youcef LAIDANI Sep 11 '16 at 18:30
  • What does it say if you press "Show Details"? – James_D Sep 11 '16 at 18:42
  • @James_D now I attached the link in Show Details you can check the details about it. – badarshahzad Sep 11 '16 at 18:48
  • @YoucefLaidani I added the code of abc.fxml – badarshahzad Sep 11 '16 at 18:48
  • 1
    "Caused by: java.lang.ClassNotFoundException: com.jfoenix.controls.JFXButton". So the first import in the .fxml file couldn't be resolved. Im not sure if sceneBuilder is even capable of handling ThirdParty controlls, otherwise you'll need to work around it. (E.g. edit the .fxml file through a plain textEditor). – n247s Sep 11 '16 at 19:10
  • Guys I don't know the error but here is another point rise after the Error Dialog Box appear then I again try to open this file this time the file open. I don't know behind the logic but please tell me what is this? My file is successfully opened in Scene Builder but still I have confusion. Why the file is not opening in first attempt? and why this Dialog Box appear first time whenever I try to open? thank you for your precious time and response. – badarshahzad Sep 11 '16 at 19:42
  • There are several questions that show how to include a third-party library into Scene Builder. For example, [this question](http://stackoverflow.com/questions/29601190/include-controls-fx-in-scene-builder) shows how to include ControlsFX: you can follow the same process for your third-party library. – James_D Sep 11 '16 at 21:24
  • @James_D please check this link I uploaded the show details https://gist.github.com/badarshahzad/d02e26a78439f5db3e74f2ebd89cfe2e I think this is not a problem of library? Do you think ? As before jfoenix jar library my Scene Builder open on one click and don't show this dialog box. Do you think Is this happening due to jfoenix jar library that I added? – badarshahzad Sep 12 '16 at 06:22
  • @Badrkhan Did you read the error message? It says it cannot find the class. – James_D Sep 12 '16 at 08:19
  • It is problem of scenebuilder. It can't load jfoenix jar library. first you have to open scenebuilder after open .fxml file. – CTN Nov 24 '16 at 03:43

4 Answers4

1

I was having the same problem. I did so many things but none work for me, So I checked my FXML file code using Notepad++ and then I realised, I have used JFonix components in FXML file. (for some reason I removed that jar from scene builder and forgot to add it again) So I added JFonix jar to scene builder and it worked for me.

Amol J
  • 111
  • 2
  • 12
0

Rather that double cliking on .fxml in project view, drag the .fxml file to scene builder interface. this should work.

Henry
  • 45
  • 1
  • 8
0

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.

badarshahzad
  • 1,227
  • 16
  • 25
0

Yes i was facing the same problem. After some time i realize that i have used some outside scenebuilder tools like jfoenix, fontawsome etc. So we must include it in scene builder also.

Wali
  • 23
  • 3