Comments (2)
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?
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.
@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:
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)
- Update MenuBar contents dynamically? HOT 3
- MenuBar not responsive after application start HOT 4
- FYI: Hugely useful for Swing as well
- Unable to quit application when setting MenuToolkit.setForceQuitOnCmdQ(false)
- Menubar not showing when using CustomMenuItem HOT 5
- Question - how about integrating this directly into JavaFX using ForeignLinker API?
- Update to JavaFX 19 with Java 17 HOT 2
- Focus Issue on Mac OS Big Sur and above HOT 1
- KeyCode.SHORTCUT not working when adding keyboard accelerators
- JFXCentral Badge HOT 1
- Windows menu retains reference to removed stages
- 3.0.0-BETA2 Events not working all of the time HOT 3
- Support for Windowless menu bar HOT 1
- setAccelerator() not working as expected HOT 3
- Provide convenience method to create Preferences MenuItem HOT 1
- Error: automatic module cannot be used with jlink: com.sun.jna HOT 6
- MenuBar not working on launch HOT 4
- Problem with popups HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nsmenufx.