EDIT:
I have seen another question about adding JPopupMenu
into TrayIcon and that solves my problem.
Adding JPopupMenu to the TrayIcon
It may be duplicate but I haven't seen it here so let me ask again:
I am with Windows 10 and Java 1.8.111. I want to make a system tray icon application in Java.
As TrayIcon
only supports setPopupMenu(PopupMenu)
, I can only use MenuItem
here. Unfortunately, here I want to render some Unicode characters and they are shown as squares in the menu. setFont()
with a Font
which supports the content has effect, because I can see the squares grow bigger as I increase the font size, but the characters are still in square.
How can I make my characters shown?
As far as I know, this rendering problem doesn't exist for JMentItem
. Adding support for JPopMenu
in TrayIcon
, thus, enabling JMenuItem
is a known bug of TrayIcon
and is urged for a long time, at least since Java 6.
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6285881
It is OS-dependant, too, because on Ubuntu 16.04 LTS, although the font is uglier, characters are shown.
Any workaround? Java FX?