Associating a Label with a Component:将标签与组件关联

<script>function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>

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);

当你想让你一个标签与组件关联时,你应该调用setLabelFor方法来显式关联,然后为这个标签设置一个助记符。

当助记符被激活时,这个被关联的组件将获得激活

你可能感兴趣的:(C++,c,C#)