A
A
Andrey2017-05-01 20:45:08
Java
Andrey, 2017-05-01 20:45:08

What is wrong with javafx file?

An error occurred while developing a javafx application, tell me what's wrong. I checked the indents, tried changing encodings, deleting elements, nothing helps. I don't understand what is wrong.
Mistake:


Exception in
Application
start
method LauncherImpl.lambda$launchApplication$152(LauncherImpl.java:182)
at com.sun.javafx.application.LauncherImpl$$Lambda$2/381259350.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: javafx.fxml.LoadException:
/F:/top_java/explorerBaseData/out/production/explorerBaseData/sample/sample.fxml
at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2605)
at javafx.fxml.FXMLLoader. loadImpl(FXMLLoader.java:2547)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2445)
at javafx.fxml.FXMLLoader.loadImpl( FXMLLoader.java:3218
)
FXMLLoader.loadImpl(FXMLLoader.java:3152)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3128)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3108)
at javafx.fxml.FXMLLoader.load(FXMLLoader .java:3101)
at sample.Main.start(Main.java:13)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(LauncherImpl.java:863)
at com.sun.javafx.application.LauncherImpl $$Lambda$52/972986655.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl$$Lambda$48/1995745829.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295)
at com.sun.javafx .application.PlatformImpl$$Lambda$50/763648663.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294)
at com.sun.javafx.application.PlatformImpl$$Lambda$49/1076728254.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass. ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$145(WinApplication.java:101)
at com.sun.glass.ui.win.WinApplication$$Lambda$38/1651775625.run(Unknown Source)
... 1 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1 ,1]
Message: Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:601)
at javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:88)
at javafx.fxml.FXMLLoader .loadImpl(FXMLLoader.java:2517)
... 22 more

The file itself:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.RadioButton?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.chart.AreaChart?>
<?import javafx.scene.chart.CategoryAxis?>
<?import javafx.scene.chart.NumberAxis?>
<?import javafx.scene.chart.PieChart?>
<TabPane xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.Controller">
    <tabs>
        <Tab text="Главная">
            <content>
                <VBox>
                    <children>
                        <HBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
                              prefHeight="400.0" prefWidth="900.0">
                            <children>
                                <VBox prefHeight="200.0" prefWidth="100.0">
                                    <children>
                                        <ListView fx:id="listModule" prefHeight="200.0" prefWidth="200.0"/>
                                        <ListView fx:id="listError" prefHeight="200.0" prefWidth="200.0"/>
                                    </children>
                                </VBox>
                                <TableView fx:id="tableError" prefHeight="400.0" prefWidth="779.0">
                                    <columns>
                                        <TableColumn fx:id="tp1" prefWidth="75.0" text="1"/>
                                        <TableColumn fx:id="tp2" prefWidth="75.0" text="2"/>
                                        <TableColumn fx:id="tp3" prefWidth="75.0" text="3"/>
                                        <TableColumn fx:id="tp4" prefWidth="75.0" text="4"/>
                                        <TableColumn fx:id="tp5" prefWidth="75.0" text="5"/>
                                        <TableColumn fx:id="tp6" prefWidth="75.0" text="6"/>
                                        <TableColumn fx:id="tp7" prefWidth="75.0" text="7"/>
                                        <TableColumn fx:id="tp8" prefWidth="75.0" text="8"/>
                                        <TableColumn fx:id="tp9" prefWidth="75.0" text="9"/>
                                        <TableColumn fx:id="tp10" prefWidth="75.0" text="10"/>
                                    </columns>
                                </TableView>
                                <VBox prefHeight="200.0" prefWidth="100.0">
                                    <children>
                                        <Label text="Выбранный модуль = Базовый"/>
                                        <Label text="Всего ошибок в модуле : 20"/>
                                        <Label text="Последняя ошибка : 20-05-2014"/>
                                        <Label text="Ошибка модуля : "/>
                                        <Label text="Ошибки в модуле: 30"/>
                                    </children>
                                </VBox>
                            </children>
                        </HBox>
                        <HBox prefHeight="100.0" prefWidth="200.0">
                            <children>
                                <Button mnemonicParsing="false" text="Поиск"/>
                                <TextField/>
                                <RadioButton mnemonicParsing="false" text="Точное совпадение"/>
                                <RadioButton mnemonicParsing="false" text="Больше"/>
                                <RadioButton mnemonicParsing="false" text="Меньше"/>
                            </children>
                        </HBox>
                    </children>
                </VBox>
            </content>
        </Tab>
        <Tab text="Статистика">
            <content>
                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
                    <children>
                        <AreaChart layoutX="14.0" layoutY="14.0" prefHeight="210.0" prefWidth="312.0">
                            <xAxis>
                                <CategoryAxis side="BOTTOM"/>
                            </xAxis>
                            <yAxis>
                                <NumberAxis side="LEFT"/>
                            </yAxis>
                        </AreaChart>
                        <PieChart layoutX="34.0" layoutY="214.0" prefHeight="213.0" prefWidth="284.0"/>
                    </children>
                </AnchorPane>
            </content>
        </Tab>
        <Tab text="Настройки">
            <content>
                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"/>
            </content>
        </Tab>
        <Tab text="Справка">
            <content>
                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"/>
            </content>
        </Tab>
    </tabs>
</TabPane>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2017-05-01
@poslannikD

Save the fxml file without the BOM label.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question