Using JavaFX encountered a problem, as seen on the screenshot, there are two elements - the menu and the browser. Both are in different files, the menu is mainly, and the browser is imported. So actually what the problem is, is that the menu items are activated only when you point them above the red line (in the screenshot), if the browser is tied to the menu closely, then you cannot interact with the menu at all. It seems that the WebView element has invisible edges. How to fix what to do? I would be happy for any hint!

Main.fxml

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.valeobet.client.controllers.MainController"> <children> <MenuBar prefHeight="29.0" prefWidth="600.0" AnchorPane.bottomAnchor="770.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <menus> <Menu mnemonicParsing="true" text="File"> <items> <MenuItem mnemonicParsing="true" text="Close"/> </items> </Menu> <Menu mnemonicParsing="false" text="Edit"> <items> <MenuItem mnemonicParsing="false" text="Delete"/> </items> </Menu> <Menu mnemonicParsing="false" text="Help"> <items> <MenuItem mnemonicParsing="false" text="About"/> </items> </Menu> </menus> </MenuBar> <fx:include fx:id="browserFXML" source="browser.fxml" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.bottomAnchor="0.0"/> </children> 

Browser.fxml

 <WebView fx:id="williamView" layoutX="76.0" layoutY="35.0" prefHeight="235.0" prefWidth="407.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="30.0" AnchorPane.bottomAnchor="300.0" /> 

Javafx application

    1 answer 1

    The problem was here

     <WebView fx:id="williamView" layoutX="76.0" layoutY="35.0" prefHeight="235.0" prefWidth="407.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="30.0" AnchorPane.bottomAnchor="300.0" /> 

    Specifically, AnchorPane.topAnchor="30.0"