org.openide.awt.Mnemonics类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(20.7k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中org.openide.awt.Mnemonics类的一些代码示例,展示了Mnemonics类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mnemonics类的具体详情如下:
包路径:org.openide.awt.Mnemonics
类名称:Mnemonics

Mnemonics介绍

[英]Support class for setting button, menu, and label text strings with mnemonics.
[中]支持使用助记符设置按钮、菜单和标签文本字符串。

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

private void initComponents() {
    org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(RevertModificationsPanel.class, "UpdatePanel.infoLabel.text")); // NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(RevertModificationsPanel.class, "UpdatePanel.infoLabel2.text")); // NOI18N
    forcedUpdateChxBox = new JCheckBox();
    org.openide.awt.Mnemonics.setLocalizedText(forcedUpdateChxBox, org.openide.util.NbBundle.getMessage(UpdatePanel.class, "UpdatePanel.forcedUpdateChxBox.text")); // NOI18N
    JPanel optionsPanel = new JPanel(new BorderLayout());
    optionsPanel.add(forcedUpdateChxBox, BorderLayout.NORTH);
    optionsPanel.setBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0));
    setOptionsPanel(optionsPanel, null);
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

setText(item, null);
int i = findMnemonicAmpersand(text);
setMnemonicIndex(item, -1);
if (i < 0) {
  setText(item, text);
  setMnemonic(item, 0);
} else {
  setText(item, text.substring(0, i) + text.substring(i + 1));
  if (isAquaLF()) {
    setMnemonic(item, 0);
  } else {
    char ch = text.charAt(i + 1);
    if (text.startsWith("<html>")) { // NOI18N
      setText(item, text.substring(0, i) + "<u>" + ch + "</u>" + text.substring(i + 2)); // NOI18N
      i += 3; // just in case it gets fixed
      setMnemonic(item, ch);
      setMnemonicIndex(item, i);
    } else {
        int latinCode = getLatinKeycode(ch);
        setMnemonic(item, latinCode);
        setMnemonicIndex(item, i);

代码示例来源:origin: org.netbeans.api/org-openide-awt

/**
 * Gets the Latin symbol which corresponds
 * to some non-Latin symbol on the localized keyboard.
 * The search is done via lookup of Resource bundle
 * for pairs having the form (e.g.) <code>MNEMONIC_\u0424=A</code>.
 * @param localeChar non-Latin character or a punctuator to be used as mnemonic
 * @return character on latin keyboard, corresponding to the locale character,
 *         or the appropriate VK_*** code (if there's no latin character
 *         "under" the non-Latin one
 */
private static int getLatinKeycode(char localeChar) throws MissingResourceException {
  // associated should be a latin character, arabic digit 
  // or an integer (KeyEvent.VK_***)
  String str = getBundle().getString("MNEMONIC_" + localeChar); // NOI18N
  if (str.length() == 1) {
    return str.charAt(0);
  } else {
    return Integer.parseInt(str);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

infoLabel1 = new JLabel();
infoLabel2 = new JLabel();
runAsPanel = new RunAsPanel(insidePanels);
Mnemonics.setLocalizedText(infoLabel1, NbBundle.getMessage(RunConfigurationPanelVisual.class, "LBL_RunConfigurationInfo1")); // NOI18N
Mnemonics.setLocalizedText(infoLabel2, NbBundle.getMessage(RunConfigurationPanelVisual.class, "LBL_RunConfigurationInfo2")); // NOI18N
runAsPanel.setLayout(new CardLayout());
);
infoLabel1.getAccessibleContext().setAccessibleName(NbBundle.getMessage(RunConfigurationPanelVisual.class, "RunConfigurationPanelVisual.infoLabel1.AccessibleContext.accessibleName")); // NOI18N
infoLabel1.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(RunConfigurationPanelVisual.class, "RunConfigurationPanelVisual.infoLabel1.AccessibleContext.accessibleDescription")); // NOI18N
infoLabel2.getAccessibleContext().setAccessibleName(NbBundle.getMessage(RunConfigurationPanelVisual.class, "RunConfigurationPanelVisual.infoLabel2.AccessibleContext.accessibleName")); // NOI18N
infoLabel2.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(RunConfigurationPanelVisual.class, "RunConfigurationPanelVisual.infoLabel2.AccessibleContext.accessibleDescription")); // NOI18N
runAsPanel.getAccessibleContext().setAccessibleName(NbBundle.getMessage(RunConfigurationPanelVisual.class, "RunConfigurationPanelVisual.runAsPanel.AccessibleContext.accessibleName")); // NOI18N
runAsPanel.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(RunConfigurationPanelVisual.class, "RunConfigurationPanelVisual.runAsPanel.AccessibleContext.accessibleDescription")); // NOI18N
getAccessibleContext().setAccessibleName(NbBundle.getMessage(RunConfigurationPanelVisual.class, "RunConfigurationPanelVisual.AccessibleContext.accessibleName")); // NOI18N

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-toolchain

collectionPanel = new javax.swing.JPanel();
compilerCollectionLabel = new javax.swing.JLabel();
compilerCollectionComboBox = new javax.swing.JComboBox();
tabPanel = new javax.swing.JPanel();
tabbedPane = new javax.swing.JTabbedPane();
setLayout(new java.awt.BorderLayout());
collectionPanel.setOpaque(false);
compilerCollectionLabel.setLabelFor(compilerCollectionComboBox);
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/cnd/toolchain/ui/compiler/Bundle"); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(compilerCollectionLabel, bundle.getString("COMPILER_COLLECTION_LBL")); // NOI18N
tabPanel.setLayout(new java.awt.BorderLayout());
tabPanel.add(tabbedPane, java.awt.BorderLayout.CENTER);
tabbedPane.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ParserSettingsPanel.class, "COMPILERS_TABBEDPANE_AN")); // NOI18N
tabbedPane.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ParserSettingsPanel.class, "COMPILERS_TABBEDPANE_AD")); // NOI18N

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-bugtracking

bar.setAlignmentX(0f);
bar.setMaximumSize(new Dimension(Short.MAX_VALUE, bar.getPreferredSize().height));
JPanel panel = new JPanel();
BoxLayout layout = new BoxLayout(panel, BoxLayout.PAGE_AXIS);
panel.setLayout(layout);
JLabel label = new JLabel();
Mnemonics.setLocalizedText(label, message);
panel.add(label);
label.setLabelFor(bar.getIssueComponent());
LayoutStyle layoutStyle = LayoutStyle.getInstance();
int gap = layoutStyle.getPreferredGap(label, bar, LayoutStyle.ComponentPlacement.RELATED, SwingConstants.SOUTH, panel);
panel.add(bar);
panel.add(Box.createVerticalStrut(gap));
ResourceBundle bundle = NbBundle.getBundle(QuickSearchComboBar.class);
JLabel hintLabel = new JLabel(bundle.getString("MSG_SelectIssueHint")); // NOI18N
hintLabel.setEnabled(false);
panel.add(hintLabel);

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-bugtracking

private JPanel createControllerPanel() {
  JPanel controllerPanel = new JPanel();
  JLabel pane = new JLabel();
  pane.setText(NbBundle.getMessage(FakeJiraConnector.class, "MSG_NOT_YET_INSTALLED")); // NOI18N
  JButton downloadButton = new JButton();
  downloadButton.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
  org.openide.awt.Mnemonics.setLocalizedText(downloadButton, org.openide.util.NbBundle.getMessage(FakeJiraConnector.class, "MissingJiraSupportPanel.downloadButton.text")); // NOI18N
  controllerPanel.setLayout(layout);
  layout.setHorizontalGroup(
    layout.createParallelGroup(GroupLayout.Alignment.LEADING)

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

public boolean showGeneralDialog () {
  JButton btn = new JButton();
  org.openide.awt.Mnemonics.setLocalizedText(btn, org.openide.util.NbBundle.getMessage(BranchSelector.class, "CTL_BranchSelectorPanel_Action_OK")); // NOI18N
  btn.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BranchSelector.class, "ACSD_BranchSelectorPanel_Action_OK")); // NOI18N
  btn.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BranchSelector.class, "ACSN_BranchSelectorPanel_Action_OK")); // NOI18N
  btn.setEnabled(false);
  return showDialog(btn, NbBundle.getMessage(BranchSelector.class, "CTL_BranchSelectorPanel.title", repository.getName()), //NOI18N
      NbBundle.getMessage(BranchSelector.class, "BranchSelectorPanel.infoLabel.text")); //NOI18N
}

代码示例来源:origin: dcaoyuan/nbscala

public JComponent getPanel() {
  if (panel != null) return panel;
  panel = new JPanel();
  ResourceBundle bundle = NbBundle.getBundle(WatchPanel.class);
  panel.getAccessibleContext ().setAccessibleDescription (bundle.getString ("ACSD_WatchPanel")); // NOI18N
  JLabel textLabel = new JLabel();
  Mnemonics.setLocalizedText(textLabel, bundle.getString ("CTL_Watch_Name")); // NOI18N
  editorPane = new JEditorPane();//expression); // NOI18N
  editorPane.setText(expression);
  sp.setPreferredSize(new Dimension(30*size, (int) (1*size) + 2));
  textLabel.setBorder (new EmptyBorder (0, 0, 5, 0));
  panel.setLayout (new BorderLayout ());
  panel.setBorder (new EmptyBorder (11, 12, 1, 11));
  panel.add (BorderLayout.NORTH, textLabel);
  panel.add (BorderLayout.CENTER, sp);
  editorPane.getAccessibleContext ().setAccessibleDescription (bundle.getString ("ACSD_CTL_Watch_Name")); // NOI18N
  editorPane.setText (expression);
  editorPane.selectAll ();
  textLabel.setLabelFor (editorPane);
  editorPane.requestFocus ();

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mobility-deployment-sonyericsson

java.awt.GridBagConstraints gridBagConstraints;
lError = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
lError.setForeground(new java.awt.Color(89, 79, 191));
org.openide.awt.Mnemonics.setLocalizedText(lError, NbBundle.getMessage(SonyEricssonCustomizerPanel.class, "ERR_MissingSDK")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
add(lError, gridBagConstraints);
org.openide.awt.Mnemonics.setLocalizedText(jButton1, NbBundle.getMessage(SonyEricssonCustomizerPanel.class, "LBL_ManageEmulators")); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
gridBagConstraints.insets = new java.awt.Insets(0, 11, 0, 0);
add(jButton1, gridBagConstraints);
jButton1.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(SonyEricssonCustomizerPanel.class, "ACSN_Manage")); // NOI18N
jButton1.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(SonyEricssonCustomizerPanel.class, "ACSD_Manage")); // NOI18N

代码示例来源:origin: org.netbeans.api/org-openide-dialogs

JPanel panel = new JPanel();
panel.setOpaque (false);
JLabel textLabel = new JLabel();
Mnemonics.setLocalizedText(textLabel, text);
textLabel.setLabelFor(textField);
panel.setLayout(layout);
if (longText) {
  layout.setHorizontalGroup(
panel.getAccessibleContext().setAccessibleDescription(
  NbBundle.getMessage(NotifyDescriptor.class, "ACSD_InputPanel")
);
textField.getAccessibleContext().setAccessibleDescription(
  NbBundle.getMessage(NotifyDescriptor.class, "ACSD_InputField")
);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-jboss4

private void initComponents() {
  java.awt.GridBagConstraints gridBagConstraints;
  jLabel1.setLabelFor(locationTextField);
  org.openide.awt.Mnemonics.setLocalizedText(jLabel1, NbBundle.getMessage(AddServerLocationVisualPanel.class, "LBL_InstallLocation"));
  gridBagConstraints = new java.awt.GridBagConstraints();
  gridBagConstraints.gridx = 0;
  add(locationTextField, gridBagConstraints);
  org.openide.awt.Mnemonics.setLocalizedText(jButton1, NbBundle.getMessage(AddServerLocationVisualPanel.class, "LBL_BrowseButton"));
  jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
      jButton1ActionPerformed(evt);
  gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 0);
  add(jButton1, gridBagConstraints);
  jButton1.getAccessibleContext().setAccessibleName(NbBundle.getMessage(AddServerLocationVisualPanel.class, "LBL_BrowseButton"));
  jButton1.getAccessibleContext().setAccessibleDescription("ACSD_Browse_Button_InstallLoc");
  gridBagConstraints.weighty = 1.0;
  add(jPanel1, gridBagConstraints);
  jPanel1.getAccessibleContext().setAccessibleName("TITLE_AddServerLocationPanel");
  jPanel1.getAccessibleContext().setAccessibleDescription("AddServerLocationPanel_Desc");

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

org.openide.awt.Mnemonics.setLocalizedText(forcedUpdateChxBox, org.openide.util.NbBundle.getMessage(SwitchToBranchAction.class, "SwitchTo.forcedUpdateChxBox.text")); // NOI18N
JPanel optionsPanel = new JPanel(new BorderLayout());
optionsPanel.add(forcedUpdateChxBox, BorderLayout.NORTH);
optionsPanel.setBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0));
switchBranch.setOptionsPanel(optionsPanel, null);
JButton okButton = new JButton();
org.openide.awt.Mnemonics.setLocalizedText(okButton, org.openide.util.NbBundle.getMessage(BranchSelector.class, "CTL_SwitchToForm_Action_SwitchTo")); // NOI18N
okButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BranchSelector.class, "ACSD_SwitchToForm_Action_SwitchTo")); // NOI18N
okButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BranchSelector.class, "ACSN_SwitchToForm_Action_SwitchTo")); // NOI18N
okButton.setEnabled(false);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

private void initComponents() {
    org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(BackoutPanel.class, "BackoutPanel.infoLabel.text")); // NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(BackoutPanel.class, "BackoutPanel.infoLabel2.text")); // NOI18N
    if(repoRev != null){
      org.openide.awt.Mnemonics.setLocalizedText(revisionsLabel,
          org.openide.util.NbBundle.getMessage(BackoutPanel.class, "CTL_ChoosenRevision")); // NOI18N
    }
    commitMsgField = new javax.swing.JTextField();
    commitLabel = new javax.swing.JLabel();
    commitLabel.setLabelFor(commitMsgField);
    commitMsgField.setText(NbBundle.getMessage(BackoutPanel.class, "BackoutPanel.commitMsgField.text", BackoutAction.HG_BACKOUT_REVISION)); //NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(commitLabel, org.openide.util.NbBundle.getMessage(BackoutPanel.class, "BackoutPanel.commitLabel.text")); // NOI18N
    commitMsgField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BackoutPanel.class, "ACSD_commitMsgField")); // NOI18N

    JPanel optionsPanel = new JPanel(new BorderLayout(10, 0));
    optionsPanel.add(commitLabel, BorderLayout.WEST);
    optionsPanel.add(commitMsgField, BorderLayout.CENTER);
    optionsPanel.setBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0));
    setOptionsPanel(optionsPanel, null);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  notActiveLabel = new JLabel();
  providerPanel = new JPanel();
  Mnemonics.setLocalizedText(notActiveLabel, NbBundle.getMessage(TestingProviderPanel.class, "TestingProviderPanel.notActiveLabel.text")); // NOI18N
  providerPanel.setLayout(new BorderLayout());
  GroupLayout layout = new GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
    layout.createParallelGroup(GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
      .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
        .addComponent(providerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addComponent(notActiveLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
      .addGap(0, 0, 0))
  );
  layout.setVerticalGroup(
    layout.createParallelGroup(GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
      .addComponent(notActiveLabel)
      .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
      .addComponent(providerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  );
}// </editor-fold>//GEN-END:initComponents

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-project

@Messages("LBL_IconInfo=Selected icon [size]:")
  private static JPanel getAccesoryPanel(final JTextField iconInfo) {
    iconInfo.setColumns(15);
    iconInfo.setEditable(false);
    
    JPanel accessoryPanel = new JPanel();
    JPanel inner = new JPanel();
    JLabel iconInfoLabel = new JLabel();
    accessoryPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0));
    
    inner.setLayout(new GridLayout(2, 1, 0, 6));
    
    iconInfoLabel.setLabelFor(iconInfo);
    Mnemonics.setLocalizedText(iconInfoLabel, LBL_IconInfo());
    inner.add(iconInfoLabel);
    
    inner.add(iconInfo);
    
    accessoryPanel.add(inner);
    return accessoryPanel;
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-groovy-grailsproject

jLabelTarget = new javax.swing.JLabel();
jComboBoxTarget = new javax.swing.JComboBox();
jButton1 = new javax.swing.JButton();
jLabelTarget.setLabelFor(jComboBoxTarget);
org.openide.awt.Mnemonics.setLocalizedText(jLabelTarget, org.openide.util.NbBundle.getMessage(LibrariesCustomizerPanel.class, "LBL_CustomizeGeneral_Platform_JLabel")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(LibrariesCustomizerPanel.class, "LBL_CustomizeGeneral_Platform_JButton")); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
    createNewPlatform(evt);
);
jLabelTarget.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LibrariesCustomizerPanel.class, "ACSD_CustomizerGeneral_jLabelTarget")); // NOI18N
jButton1.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LibrariesCustomizerPanel.class, "ACSD_CustomizerGeneral_jButton1")); // NOI18N

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

private void initComponents () {
  org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(ExportDiffPanel.class, "ExportDiffPanel.jLabel1.text")); // NOI18N
  if(fileToDiff != null){
    org.openide.awt.Mnemonics.setLocalizedText(revisionsLabel, NbBundle.getMessage(ExportDiffPanel.class,
        "ExportDiffPanel.revisionsLabel.text.forFileDiff")); // NOI18N
    jLabel2.setText(NbBundle.getMessage(ExportDiffPanel.class,
        "ExportDiffPanel.exportHintLabel.text.forFileDiff")); // NOI18N
  } else {
    org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(ExportDiffPanel.class, "LBL_EXPORT_INFO")); // NOI18N
  }
  getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ExportDiffPanel.class, "ExportDiffPanel.AccessibleContext.accessibleDescription")); // NOI18N
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

panel.propsPanel.setLayout(new BorderLayout());
panel.propsPanel.add(component, BorderLayout.CENTER);
DialogDescriptor dd = new DialogDescriptor(panel, org.openide.util.NbBundle.getMessage(PropertiesAction.class, "CTL_PropertiesDialog_Title", null), true, null); // NOI18N
JButton okButton =  new JButton();
org.openide.awt.Mnemonics.setLocalizedText(okButton, org.openide.util.NbBundle.getMessage(PropertiesAction.class, "CTL_Properties_Action_OK"));
okButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(PropertiesAction.class, "ACSN_Properties_Action_OK")); // NOI18N
okButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PropertiesAction.class, "ACSD_Properties_Action_OK")); 
JButton cancelButton =  new JButton();
org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(PropertiesAction.class, "CTL_Properties_Action_Cancel"));
cancelButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(PropertiesAction.class, "ACSN_Properties_Action_Cancel")); // NOI18N
cancelButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PropertiesAction.class, "ACSD_Properties_Action_Cancel")); 
dd.setOptions(new Object[] {okButton, cancelButton});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-navigation

/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  jButton1 = new javax.swing.JButton();
  setLayout(new java.awt.BorderLayout());
  org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(MacroExpansionTopComponent.class, "NoViewAvailable")); // NOI18N
  jButton1.setBorderPainted(false);
  jButton1.setEnabled(false);
  add(jButton1, java.awt.BorderLayout.CENTER);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables

相关文章