Code Monkey home page Code Monkey logo

Comments (2)

Oliver-Loeffler avatar Oliver-Loeffler commented on August 18, 2024

For each MenuBar, it might be required to set the property useSystemMenuBar to true.
This can be achieved using recent versions of Scene Builder or manually in the FXML.

Do the new Scenes and Stages also have their own menus?

Bildschirmfoto 2022-10-22 um 20 18 27

The FXML looks as follows:

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

<?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/19" xmlns:fx="http://javafx.com/fxml/1">
   <children>
      <MenuBar prefHeight="11.0" prefWidth="140.0" useSystemMenuBar="true">
        <menus>
          <Menu mnemonicParsing="false" text="File">
            <items>
              <MenuItem mnemonicParsing="false" 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>
   </children>
</AnchorPane>

In Java code its:

MenuBar menuBar = new MenuBar();
menuBar.useSystemMenuBarProperty().setValue(true);

from nsmenufx.

EasyG0ing1 avatar EasyG0ing1 commented on August 18, 2024

@Oliver-Loeffler Sorry I didn't catch that you commented on here till today.

To answer your question, NO, those other windows do not have any menu on them at all, and I don't use FXML ... I stopped using it years ago. So for example, the screenshot I showed you normally looks like this:

Screenshot 2023-01-26 at 11 55 26 AM

But when I use your library, it throws a menu on every Scene for some reason. I only have one window with a menu and everything else is dialogue style only built manually with standard Scenes and Stages.

from nsmenufx.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.