Menus: support HTML in new layout (issue #3)

This commit is contained in:
Karl Tauber
2020-04-26 10:35:23 +02:00
parent fcbb3aeed1
commit 115a2df2b0
3 changed files with 20 additions and 6 deletions

View File

@@ -197,7 +197,7 @@ public class FlatMenusTest
panel1.add(checkBoxMenuItemLabel, "cell 0 2");
//---- checkBoxMenuItem1 ----
checkBoxMenuItem1.setText("enabled");
checkBoxMenuItem1.setText("<html>en<b>abl</b>ed</html>");
checkBoxMenuItem1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
checkBoxMenuItem1.setMnemonic('A');
panel1.add(checkBoxMenuItem1, "cell 1 2");

View File

@@ -92,7 +92,7 @@ new FormModel {
} )
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
name: "checkBoxMenuItem1"
"text": "enabled"
"text": "<html>en<b>abl</b>ed</html>"
"accelerator": &KeyStroke0 static javax.swing.KeyStroke getKeyStroke( 112, 0, false )
"mnemonic": 65
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {