📄 e692. associating a label with a component.txt
字号:
When a label is associated with a component, you should call setLabelFor() to make the association explicit and then set a mnemonic on the label. The associated component will get the focus when the mnemonic is activated.
JLabel label = new JLabel("Name:");
label.setDisplayedMnemonic('N');
label.setLabelFor(component);
Related Examples
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -