Comments (5)
If you use the addMenuItem(javafx.scene.control.MenuItem)
API, it always inserts at the end of the menu item list. But, there is also a insertMenuItem(javafx.scene.control.MenuItem, int)
to insert at a menu item at a certain position.
from fxtrayicon.
Closing, considering the comment made by @dwalluck
I will consider implementing an index setting for the "Exit" item in future releases, though if you wanted to create your own custom "Exit" item, it simply calls Platform.setImplicitExit(true); Platform.exit();
from fxtrayicon.
@dlemmermann - There is already a Builder method for automatically adding an Exit menu to the bottom of the trayIcon - note the .addExitMenuItem() in this build sentence:
trayIcon = new FXTrayIcon.Builder(stage, getClass().getResource("FXIconRedYellow.png"))
.toolTip("An alternative tooltip!")
.menuItem(menuItemTest)
.menuItem(menuOptions)
.applicationTitle("FXTrayIcon Builder Text")
.separator()
.addExitMenuItem()
.build();
I'm going to add the option of setting the label as desired in my next PR.
from fxtrayicon.
Maybe he wants additional methods that add a position index parameter, but I guess a builder is meant to only be called once and it adds the menus in called order.
from fxtrayicon.
@dwalluck The Builder does add the menuItems in the order that they are inserted into the build sentence. But the exitMenu can be added anywhere in the build sentence and it will always get placed at the bottom of the menu.
I also think that some kind of an indexing structure would be handy, I might start a new issue on that topic to open it up for some discussion as to how that should look from a usability perspective. I've got some ideas but it's always nice to get everyone's input on that kind of thing.
from fxtrayicon.
Related Issues (20)
- usage in modular fx project? HOT 1
- Ubuntu 20.04 UnsupportedOperationException: SystemTray icons are not supported HOT 1
- NullPointerException when null MenuItem() HOT 3
- When another thread is running, some codding stops working! HOT 5
- After adding menu items, Actions listener on menu items not working HOT 2
- Clicking two time on Tray icon show empty stage? HOT 4
- After adding checkMenuItem, chech or uncheck not working HOT 1
- How to set Taskbar icon to JFXFileChooser? HOT 1
- Icon resolution limited to 16x16 on Windows HOT 1
- Only square icons possible? HOT 8
- addMenuItem after tray is shown throws exception HOT 8
- Feature Request: Make getTrayIcon() public HOT 8
- showMessage() title of the notification window HOT 6
- Icon Size Discussion HOT 1
- Blurry Icon with FXTrayIcon, Clearer Icon with AWT HOT 1
- Tray icon is non-transparent on some Linux desktop environments HOT 4
- JFXCentral Badge HOT 1
- TrayMenu can't show unicode characters HOT 1
- Maven central version HOT 3
- Menu size issue (high dpi) HOT 3
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 fxtrayicon.