I have the following FXML file
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<TableView layoutX="54.0" layoutY="136.0" prefHeight="200.0" prefWidth="495.0">
<columns>
<TableColumn prefWidth="75.0" text="الرصيد" />
<TableColumn prefWidth="75.0" text="ملاحظات" />
<TableColumn prefWidth="75.0" text="دائن" />
<TableColumn prefWidth="75.0" text="مدين" />
<TableColumn prefWidth="75.0" text="التاريخ" />
</columns>
</TableView>
</children>
</AnchorPane>
File encoding is UTF-8 as mentioned above. When I run my project it displays like this:
Why is it displayed like that? what is wrong? FYI I am using MacOS
The issue was in the JDK version not the JavaFX version nor the MacOS version. I was using JavaFX 17.0.6 and JDK 11, which caused the issue. When I updated my JDK to version 21. It worked just fine as shown below:
Thanks to @jewelsea who suggested I update my JDK.