javax.swing.JCheckBox.getAccessibleContext()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(18.2k)|赞(0)|评价(0)|浏览(156)

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

JCheckBox.getAccessibleContext介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

);
nonLandPermanentsInOnePile.getAccessibleContext().setAccessibleName("nonLandPermanentsInOnePile");

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

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

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

void makeAccessibleCheckBox(JCheckBox box, Property p) {
  box.getAccessibleContext().setAccessibleName(p.getDisplayName());
  box.getAccessibleContext().setAccessibleDescription(p.getShortDescription());
  Object mnemonicChar = p.getValue(ATTR_MNEMONIC_CHAR);
  if ((null != mnemonicChar) && (mnemonicChar.toString().length() > 0)) {
    box.setMnemonic(mnemonicChar.toString().charAt(0));
  }
}

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

private void initComponents() {
  setLayout(new BorderLayout());
  checkBox = new JCheckBox();
  if (rbLabel != null) {
    Mnemonics.setLocalizedText(checkBox, rbLabel);
  }
  
  checkBox.getAccessibleContext().setAccessibleName( checkBox.getText());
  checkBox.getAccessibleContext().setAccessibleDescription(
      checkBox.getText());
  
  checkBox.addActionListener(this);
  add(checkBox, BorderLayout.CENTER);
}

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

public HgShelveChangesSupport () {
  doBackupChxBox = new JCheckBox();
  org.openide.awt.Mnemonics.setLocalizedText(doBackupChxBox, org.openide.util.NbBundle.getMessage(ShelveChangesAction.class, "ShelvePanel.doBackupChxBox.text")); //NOI18N
  doBackupChxBox.setToolTipText(org.openide.util.NbBundle.getMessage(ShelveChangesAction.class, "ShelvePanel.doBackupChxBox.desc")); //NOI18N
  doBackupChxBox.getAccessibleContext().setAccessibleDescription(doBackupChxBox.getToolTipText());
  doBackupChxBox.setSelected(HgModuleConfig.getDefault().getBackupOnRevertModifications());
  doPurgeChxBox = new JCheckBox();
  org.openide.awt.Mnemonics.setLocalizedText(doPurgeChxBox, org.openide.util.NbBundle.getMessage(ShelveChangesAction.class, "ShelvePanel.doPurgeChxBox.text")); //NOI18N
  doPurgeChxBox.setToolTipText(org.openide.util.NbBundle.getMessage(ShelveChangesAction.class, "ShelvePanel.doPurgeChxBox.desc")); //NOI18N
  doPurgeChxBox.getAccessibleContext().setAccessibleDescription(doPurgeChxBox.getToolTipText());
  doPurgeChxBox.setSelected(HgModuleConfig.getDefault().isRemoveNewFilesOnRevertModifications());
  optionsPanel = new JPanel();
  optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.Y_AXIS));
  optionsPanel.add(doBackupChxBox);
  optionsPanel.add(doPurgeChxBox);
}

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

void makeAccessibleCheckBox(JCheckBox box, Property p) {
  box.getAccessibleContext().setAccessibleName(p.getDisplayName());
  box.getAccessibleContext().setAccessibleDescription(p.getShortDescription());
  Object mnemonicChar = p.getValue(ATTR_MNEMONIC_CHAR);
  if ((null != mnemonicChar) && (mnemonicChar.toString().length() > 0)) {
    box.setMnemonic(mnemonicChar.toString().charAt(0));
  }
}

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

private void initComponents() {
  setLayout(new BorderLayout());
  checkBox = new JCheckBox();
  if (rbLabel != null) {
    Mnemonics.setLocalizedText(checkBox, rbLabel);
    checkBox.getAccessibleContext().setAccessibleName(
        checkBox.getText());
    checkBox.getAccessibleContext().setAccessibleDescription(
        checkBox.getText());
  }
  checkBox.addActionListener(this);
  add(checkBox, BorderLayout.CENTER);
}

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

private void initComponents() {
    org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(RevertModificationsPanel.class, "RevertModificationsPanel.infoLabel.text")); // NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(RevertModificationsPanel.class, "RevertModificationsPanel.infoLabel2.text")); // NOI18N

    doBackupChxBox = new JCheckBox();
    org.openide.awt.Mnemonics.setLocalizedText(doBackupChxBox, org.openide.util.NbBundle.getMessage(RevertModificationsPanel.class, "RevertModificationsPanel.doBackupChxBox.text")); // NOI18N
    boolean doBackup = HgModuleConfig.getDefault().getBackupOnRevertModifications();
    doBackupChxBox.setSelected(doBackup);
    doPurgeChxBox = new JCheckBox();
    org.openide.awt.Mnemonics.setLocalizedText(doPurgeChxBox, org.openide.util.NbBundle.getMessage(RevertModificationsPanel.class, "RevertModificationsPanel.doPurgeChxBox.text")); // NOI18N
    doPurgeChxBox.setToolTipText(org.openide.util.NbBundle.getMessage(RevertModificationsPanel.class, "RevertModificationsPanel.doPurgeChxBox.desc")); // NOI18N
    doPurgeChxBox.getAccessibleContext().setAccessibleDescription(doPurgeChxBox.getToolTipText());
    boolean doPurge = HgModuleConfig.getDefault().isRemoveNewFilesOnRevertModifications();
    doPurgeChxBox.setSelected(doPurge);
    JPanel optionsPanel = new JPanel();
    optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.Y_AXIS));
    optionsPanel.add(doBackupChxBox);
    optionsPanel.add(doPurgeChxBox);
    optionsPanel.setBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0));
    setOptionsPanel(optionsPanel, null);
  }
}

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

private void initAccessibility() {
  this.getAccessibleContext().setAccessibleDescription(getMessage("ACS_BasicSettingsPanel"));
  cbOpenedOnStart.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_OpenOnStart"));
  cbKeepPrefSize.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_KeepPrefSize"));
  comMode.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_Mode"));
}

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

private void setAccessible() {
  getAccessibleContext().setAccessibleDescription(getBundleString("FixDupImportStmts_IntroLbl")); // NOI18N
  checkUnusedImports.getAccessibleContext().setAccessibleDescription(getBundleString("FixDupImportStmts_checkUnusedImports_a11y")); // NOI18N
}

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

private void initMnemonics() {
  cbMarkOccurrences.setMnemonic(getString("EnableMarkOccurrences_Mnemonic").charAt(0));
  cbKeepMarks.setMnemonic(getString("KeepMarks_Mnemonic").charAt(0));
  cbMarkOccurrences.setToolTipText(getString("EnableMarkOccurrences_AD"));
  cbKeepMarks.setToolTipText(getString("KeepMarks_AD"));
  cbMarkOccurrences.getAccessibleContext().setAccessibleDescription(getString("EnableMarkOccurrences_AD"));
  cbKeepMarks.getAccessibleContext().setAccessibleDescription(getString("KeepMarks_AD"));
}

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

/** Create the wizard panel and set up some basic properties. */
public WrapperPanel(WrapperSelection wizardPanel) {
  this.wizardPanel=wizardPanel;
  initComponents();
  // Provide a name in the title bar.
  setName(NbBundle.getMessage(WrapperPanel.class, "TITLE_wrapperPanel"));
  /*
  // Optional: provide a special description for this pane.
  // You must have turned on WizardDescriptor.WizardPanel_helpDisplayed
  // (see descriptor in standard iterator template for an example of this).
  try {
    putClientProperty (WizardDescriptor.PROP_HELP_URL, // NOI18N
      new URL ("nbresloc:/org/netbeans/modules/web/wizards/WrapperPanelHelp.html")); // NOI18N
  } catch (MalformedURLException mfue) {
    throw new IllegalStateException (mfue.toString ());
  }
   */
  // a11y part
  getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(WrapperPanel.class, "A11Y_DESC_wrapperPanel"));
  jCheckBox1.getAccessibleContext().setAccessibleName(jCheckBox1.getText());
  jCheckBox1.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(WrapperPanel.class, "A11Y_DESC_wrapperPanel"));
}

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

private void initComponents() {
  setLayout(new BorderLayout());
  foreverCheckBox = new JCheckBox();
  foreverCheckBox.addActionListener(this);
  foreverCheckBox.addFocusListener(this);
  Mnemonics.setLocalizedText(foreverCheckBox, NbBundle.getMessage(PropertyEditorTimeout.class, "LBL_TIMEOUTPE_FOREVER")); // NOI18N
  add(foreverCheckBox, BorderLayout.NORTH);
  foreverCheckBox.getAccessibleContext().setAccessibleName(
      NbBundle.getMessage(PropertyEditorTimeout.class,
      "ACSN_TIMEOUTPE_FOREVER")); // NOI18N
  foreverCheckBox.getAccessibleContext().setAccessibleDescription(
      NbBundle.getMessage(PropertyEditorTimeout.class,
      "ACSD_TIMEOUTPE_FOREVER")); // NOI18N
  textField = new JTextField();
  textField.getDocument().addDocumentListener(this);
  textField.addFocusListener(this);
  add(textField, BorderLayout.SOUTH);
  textField.getAccessibleContext().setAccessibleName(
      NbBundle.getMessage(PropertyEditorTimeout.class,
      "ACSN_TIMEOUTPE_VALUE")); // NOI18N
  textField.getAccessibleContext().setAccessibleDescription(
      NbBundle.getMessage(PropertyEditorTimeout.class,
      "ACSD_TIMEOUTPE_VALUE")); // NOI18N
}

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

private void initComponents() {
  JTextArea localTopMessage = new javax.swing.JTextArea();
  jCheckBox1 = new javax.swing.JCheckBox();
  
  setLayout(new java.awt.BorderLayout(0, 12));
  
  setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(5, 5, 5, 5)));
  getAccessibleContext().setAccessibleDescription(msg);
  
  localTopMessage.setLineWrap (true);
  localTopMessage.setWrapStyleWord (true);
  localTopMessage.setEditable (false);
  localTopMessage.setEnabled (false);
  localTopMessage.setOpaque (false);
  localTopMessage.setDisabledTextColor (javax.swing.UIManager.getColor ("Label.foreground"));  // NOI18N
  localTopMessage.setFont (javax.swing.UIManager.getFont ("Label.font")); // NOI18N
  StringBuilder lTopMessage = new StringBuilder();
  lTopMessage.append(msg);
  localTopMessage.setText(lTopMessage.toString());
  add(localTopMessage, java.awt.BorderLayout.NORTH);
  
  Mnemonics.setLocalizedText(jCheckBox1, NbBundle.getMessage (NotWebFolder.class, "CTL_ShowDialog"));
  jCheckBox1.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage (NotWebFolder.class, "ACSD_CTL_ShowDialog"));
  add(jCheckBox1, java.awt.BorderLayout.SOUTH);
}

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

private void initComponents() {
  setLayout(new BorderLayout());
  unlockedCheckBox = new JCheckBox();
  unlockedCheckBox.addActionListener(this);
  unlockedCheckBox.addFocusListener(this);
  Mnemonics.setLocalizedText(unlockedCheckBox, NbBundle.getMessage(PropertyEditorPreferredSize.class, "LBL_PREF_SIZE_UNLOCKED")); // NOI18N
  unlockedCheckBox.getAccessibleContext().setAccessibleName(
      NbBundle.getMessage(PropertyEditorPreferredSize.class,
      "ACSN_PREF_SIZE_UNLOCKED"));
  unlockedCheckBox.getAccessibleContext().setAccessibleDescription(
      NbBundle.getMessage(PropertyEditorPreferredSize.class,
      "ACSD_PREF_SIZE_UNLOCKED"));
  add(unlockedCheckBox, BorderLayout.NORTH);
  textField = new JTextField();
  textField.getAccessibleContext().setAccessibleName(
      radioButton.getAccessibleContext().getAccessibleName());
  textField.getAccessibleContext().setAccessibleDescription(
      radioButton.getAccessibleContext().getAccessibleDescription());
  textField.getDocument().addDocumentListener(this);
  textField.addFocusListener(this);
  add(textField, BorderLayout.SOUTH);
}

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

@Override
public void initComponents( JPanel mainPanel , 
    final TargetChooserPanel<FileType> panel,
    final TargetChooserPanelGUI<FileType> uiPanel ) 
{
  super.initComponents(mainPanel, panel, uiPanel);
  
  uiPanel.setNameLabel(
      NbBundle.getMessage(JSFTargetPanelProvider.class, "LBL_JspName"));
  getJspSyntaxButton().setText(NbBundle.getMessage(
      JSFTargetPanelProvider.class, "OPT_JspSyntax"));
  getJspSyntaxButton().getAccessibleContext().setAccessibleDescription(
    NbBundle.getMessage(JSFTargetPanelProvider.class, "DESC_JSP"));
  
  myFaceletsSyntaxButton.setText(NbBundle.getMessage(
      JSFTargetPanelProvider.class, "OPT_Facelets"));
  myFaceletsSyntaxButton.getAccessibleContext().setAccessibleDescription(
      NbBundle.getMessage(JSFTargetPanelProvider.class, "DESC_FACELETS"));
  
  getSegmentBox().setText(NbBundle.getMessage(JSFTargetPanelProvider.class, "OPT_JspSegment"));
  getSegmentBox().getAccessibleContext().setAccessibleDescription(
    NbBundle.getMessage(JSFTargetPanelProvider.class, "A11Y_DESC_JSP_segment"));
  getDescription().setText(NbBundle.getMessage(
      JSFTargetPanelProvider.class,"DESC_FACELETS"));
}

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

@Override
public void initComponents( JPanel mainPanel , TargetChooserPanel<FileType> panel  ,
    TargetChooserPanelGUI<FileType> uiPanel ) {
  super.initComponents(mainPanel, panel, uiPanel );
  
  uiPanel.setNameLabel(NbBundle.getMessage(
      JspTargetPanelProvider.class, "LBL_JspName"));
  getJspSyntaxButton().setText(NbBundle.getMessage(JspTargetPanelProvider.class, 
      "OPT_JspSyntax"));
  getJspSyntaxButton().getAccessibleContext().setAccessibleDescription(
    NbBundle.getMessage(JspTargetPanelProvider.class, "DESC_JSP"));
  
  getXmlSyntaxButton().setText(NbBundle.getMessage(
      JspTargetPanelProvider.class, "OPT_XmlSyntax"));
  getXmlSyntaxButton().getAccessibleContext()
      .setAccessibleDescription(
          NbBundle.getMessage(JspTargetPanelProvider.class,
              "DESC_JSP_XML"));
  
  getSegmentBox().setText(NbBundle.getMessage(JspTargetPanelProvider.class, 
      "OPT_JspSegment"));
  getSegmentBox().getAccessibleContext().setAccessibleDescription(
    NbBundle.getMessage(JspTargetPanelProvider.class, "A11Y_DESC_JSP_segment"));
  getDescription().setText(NbBundle.getMessage(JspTargetPanelProvider.class,
      "DESC_JSP"));
}

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

private void initAccessibility() {
  this.getAccessibleContext().setAccessibleDescription(getMessage("ACS_OptionsPanel0"));
  advancedButton.getAccessibleContext().setAccessibleDescription(getMessage("ACS_LBL_Advanced"));
  optionsCategoryButton.getAccessibleContext().setAccessibleDescription(getMessage("ACS_LBL_OptionsCategory"));
  secondaryPanelTitle.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_DisplayName"));
  categoryNameField.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_CategoryName"));
  iconField.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_IconPath"));
  iconButton.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_IconButton"));
  allowSecondaryPanelsCheckBox.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_AllowSecondaryPanels"));
  primaryPanelCombo.getAccessibleContext().setAccessibleDescription(getMessage("ACS_CTL_PrimaryPanelCombo"));
}

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

/** Creates new form CommandLineEditorPanel */
public OptionsEditorPanel(String[] texts, BooleanConfiguration inheritValues, PropertyEditorSupport editor, PropertyEnv env) {
this.inheritValues = inheritValues;
  this.editor = editor;
  initComponents();
  // The following line was copied from the generated code (which was reset to default)
  // so I can add an NOI18N comment
  allOptionsTextArea.setBackground(javax.swing.UIManager.getDefaults().getColor("TextField.inactiveBackground")); // NOI18N
  
additionalLabel.setText(texts[2]);
allLabel.setText(texts[3]);
  setPreferredSize(new java.awt.Dimension(400, 300));
  CndUIUtilities.requestFocus(additionalOptionsTextArea);
if (inheritValues != null) {
  inheritCheckBox.setSelected(inheritValues.getValue());
}
else {
  remove(inheritCheckBox);
}
  
  env.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
  env.addPropertyChangeListener(this);
  
  // Accessibility
  additionalOptionsTextArea.getAccessibleContext().setAccessibleDescription(getString("ADDITIONAL_OPTIONS_AD"));
  inheritCheckBox.getAccessibleContext().setAccessibleDescription(getString("INHERIT_AD"));
}

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

public StringListPanel(String label, List<String> data, boolean addPathPanel, BooleanConfiguration inheritValues, String inheritText, PropertyEditorSupport editor, PropertyEnv env, HelpCtx helpCtx) {
  this.addPathPanel = addPathPanel;
  this.inheritValues = inheritValues;
  this.editor = editor;
  this.helpCtx = helpCtx;
  initComponents();
  myListEditorPanel = new MyListEditorPanel(label, data);
  java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
  gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
  gridBagConstraints.weightx = 1.0;
  gridBagConstraints.weighty = 1.0;
  listPanel.add(myListEditorPanel, gridBagConstraints);
  if (inheritValues != null) {
    inheritEditorPane.setFont(UIManager.getFont("Label.font")); //NOI18N
    inheritEditorPane.setBackground(inheritPanel.getBackground());
    inheritEditorPane.setText(inheritText);
    inheritEditorPane.setCaretPosition(0);
    setPreferredSize(new java.awt.Dimension(450, 330));
    inheritCheckBox.setSelected(inheritValues.getValue());
  } else {
    remove(inheritPanel);
    //setPreferredSize(new java.awt.Dimension(450, 350));
    setPreferredSize(new java.awt.Dimension(450, 220));
  }
  env.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
  env.addPropertyChangeListener(this);
  // Accessibility
  inheritCheckBox.getAccessibleContext().setAccessibleDescription(getString("INHERIT_CHECKBOX_AD"));
}

相关文章

JCheckBox类方法