當前位置: 首頁>>代碼示例>>Java>>正文


Java JBLabel.setDisplayedMnemonic方法代碼示例

本文整理匯總了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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:GitCompareBranchesLogPanel.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:44,代碼來源:GitUserNameNotDefinedDialog.java


注:本文中的com.intellij.ui.components.JBLabel.setDisplayedMnemonic方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。