0

I want to set my Menuitem in Java unclickable. It should be shown, but not clickable and there shouldn't be a hover color, when you go with your mouse over it. In other words, I want to show a text for info in System-Tray menu. It has no onclick function. The System Tray and the showing works completly, I only need help for this problem above.

 MenuItem itmPrgName = new MenuItem(Main.programmName + " " + Main.version);

How to do this?

mKorbel
  • 109,525
  • 20
  • 134
  • 319
bbholzbb
  • 1,832
  • 3
  • 19
  • 28

1 Answers1

1

I want to set my Menuitem in Java unclickable. It should be shown, but not clickable and there shouldn't be a hover color, when you go with your mouse over it. In other words, I want to show a text for info in System-Tray menu. It has no onclick function.

  • use JPopup as container put there JLabel / JTextArea(setEditable(false)) / JTextPane (setEditable(false)) or JPanel contains different amount of JComponents

  • set proper LayoutManager for JPopup or JPanel if needed

mKorbel
  • 109,525
  • 20
  • 134
  • 319