本文整理匯總了Java中com.intellij.ui.components.JBLabel.setDisplayedMnemonic方法的典型用法代碼示例。如果您正苦於以下問題:Java JBLabel.setDisplayedMnemonic方法的具體用法?Java JBLabel.setDisplayedMnemonic怎麽用?Java JBLabel.setDisplayedMnemonic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.ui.components.JBLabel
的用法示例。
在下文中一共展示了JBLabel.setDisplayedMnemonic方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createNorthPanel
import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
private JComponent createNorthPanel() {
final JComboBox repoSelector = new JComboBox(ArrayUtil.toObjectArray(myCompareInfo.getRepositories(), GitRepository.class));
repoSelector.setRenderer(new GitRepositoryComboboxListCellRenderer(repoSelector));
repoSelector.setSelectedItem(myInitialRepo);
repoSelector.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
GitRepository selectedRepo = (GitRepository)repoSelector.getSelectedItem();
myHeadToBranchListPanel.setCommits(getHeadToBranchCommits(selectedRepo));
myBranchToHeadListPanel.setCommits(getBranchToHeadCommits(selectedRepo));
}
});
JPanel repoSelectorPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
JBLabel label = new JBLabel("Repository: ");
label.setLabelFor(repoSelectorPanel);
label.setDisplayedMnemonic(KeyEvent.VK_R);
repoSelectorPanel.add(label);
repoSelectorPanel.add(repoSelector);
if (myCompareInfo.getRepositories().size() < 2) {
repoSelectorPanel.setVisible(false);
}
return repoSelectorPanel;
}
示例2: createCenterPanel
import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@Override
protected JComponent createCenterPanel() {
JLabel icon = new JLabel(UIUtil.getWarningIcon(), SwingConstants.LEFT);
JLabel description = new JLabel(getMessageText());
myNameTextField = new JTextField(20);
JBLabel nameLabel = new JBLabel("Name: ");
nameLabel.setDisplayedMnemonic('n');
nameLabel.setLabelFor(myNameTextField);
myEmailTextField = new JTextField(20);
JBLabel emailLabel = new JBLabel("E-mail: ");
emailLabel.setDisplayedMnemonic('e');
emailLabel.setLabelFor(myEmailTextField);
if (myProposedValues != null) {
myNameTextField.setText(myProposedValues.getFirst());
myEmailTextField.setText(myProposedValues.getSecond());
}
else {
myNameTextField.setText(SystemProperties.getUserName());
}
myGlobalCheckbox = new JBCheckBox("Set properties globally", true);
myGlobalCheckbox.setMnemonic('g');
JPanel rootPanel = new JPanel(new GridBagLayout());
GridBag g = new GridBag()
.setDefaultInsets(new Insets(0, 0, DEFAULT_VGAP, DEFAULT_HGAP))
.setDefaultAnchor(GridBagConstraints.LINE_START)
.setDefaultFill(GridBagConstraints.HORIZONTAL);
rootPanel.add(description, g.nextLine().next().coverLine(3).pady(DEFAULT_HGAP));
rootPanel.add(icon, g.nextLine().next().coverColumn(3));
rootPanel.add(nameLabel, g.next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
rootPanel.add(myNameTextField, g.next());
rootPanel.add(emailLabel, g.nextLine().next().next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
rootPanel.add(myEmailTextField, g.next());
rootPanel.add(myGlobalCheckbox, g.nextLine().next().next().coverLine(2));
return rootPanel;
}