0

For me the setLabel method of the java's JPopupMenu does not work.

Here is a simple popup menu example:

http://www.java2s.com/Code/Java/Swing-JFC/AsimpleexampleofJPopupMenu.htm

Inside is:

public JPopupMenu popup;
popup = new JPopupMenu();
popup.setLabel("Justification");

But when I launch the script, my popup menu has no label "Justification":

enter image description here

However, the documentation says this is the right way to define labels:

public void setLabel(String label)

http://docs.oracle.com/javase/7/docs/api/javax/swing/JPopupMenu.html#setLabel%28java.lang.String%29

I am using Eclipse 3.7.2, with JRE 1.7_067.

Of course, the same problem occurs on my own project...

Any help would be greatly appreciated!

Regards,

taalf
  • 179
  • 1
  • 10
  • The setLabel documentation says 'Different look and feels may choose to display or not display this', most choose not to display. See [this question](http://stackoverflow.com/q/8546073/2670892) – greg-449 Sep 15 '14 at 11:05
  • Thank you very much @greg-449 ! From a java beginner :) – taalf Sep 15 '14 at 11:11

0 Answers0