3

My problem is that when I open my file fxml in NetBeans I get these lines of code which are the correct ones:

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

<? import javafx.geometry.Insets?>
<? import javafx.scene.control.Button?>
<? import javafx.scene.control.TextField?>
<? import javafx.scene.layout.AnchorPane?>
<? import javafx.scene.layout.ColumnConstraints?>
<? import javafx.scene.layout.GridPane?>
<? import javafx.scene.layout.RowConstraints?>

<AnchorPane maxHeight = "- Infinity" maxWidth = "- Infinity" minHeight = "345.0" minWidth = "200.0" prefHeight = "545.0" prefWidth = "400.0" xmlns = "http://javafx.com/javafx/8.0.141 "xmlns: fx =" http://javafx.com/fxml/1 ">
<children>
<GridPane layoutY = "25.0" AnchorPane.bottomAnchor = "0.0" AnchorPane.leftAnchor = "0.0" AnchorPane.rightAnchor = "0.0" AnchorPane.topAnchor = "0.0">
<columnConstraints>

But when I change the fxml with the Scene builder and save it, he changes this particular code part:

  • How it should be:

    xmlns = "http://javafx.com/javafx/8.0.141" xmlns: fx = "http://javafx.com/fxml/1">
    
  • but when I save it, Scene Builder changes it for this:

    xmlns = "http://javafx.com/javafx/9" xmlns: fx = "http://javafx.com/fxml/1"
    

This causes me to throw an error that sometimes nothing happens but sometimes my application does not open. What can I do so that the Scene Builder does not change the version of xmlns?

fabian
  • 80,457
  • 12
  • 86
  • 114
JuanjoMB98
  • 33
  • 6
  • 4
    It seems you are using Scene Builder 9.0.1, aren't you? If you want to use Java 8 (and NetBeans 8.2), you should stick to Scene Builder 8.4.1. This will run on JDK8 and set `xmlns` accordingly. – José Pereda Mar 01 '18 at 23:00
  • Thanks you ! You are right, i can solve my problem thanks rly ! Sorry for my bad english – JuanjoMB98 Mar 02 '18 at 09:48

0 Answers0