java - Cannot set mnemonic in JLabel with HTML text -


The following associates set a JLabel and a memorable one with JTextArea, which punishes the label by pressing Alt-X on Windows Takes focus to JTextArea.

  JTextArea textArea = new JTextArea (10, 20); Jlab label = new jlabel ("text"); Label.setLabelFor (text field); Label.setDisplayedMnemonic (KeyEvent.VK_X);  

However, if the label uses HTML, the label is displayed as expected, but it is not decorated with memnic.

  JTextArea textArea = new JTextArea (); Jlab label label = new jlabel (" text "); // !!! No decoration label. Catalabelför (Textaria); Label.setDisplayedMnemonic (KeyEvent.VK_X);  

Is this expected behavior?

Edit 1 : Modifies the example to use inhuman, which is not part of the HTML tag based on Aziz's answer.

Edit 2 : Further experiments indicate that since the use of this look and fail, the key is not working.

Basic labelUII takes different colors on the label, depending on whether it gets HTML or not. If not, Basic LabellUI has called some of its functions which are underlined. If this happens, then the basic HTML. The renderer is used, and it does not depict any framework.

This would be the easiest solution:

  JLabel label = new JLabel "& lt; html> to  X  / u & Gt; T & lt; / html & gt; ");  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -