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

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

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

JCheckBox.addFocusListener介绍

暂无

代码示例

代码示例来源:origin: marytts/marytts

  1. cbSelected.addFocusListener(new java.awt.event.FocusAdapter() {
  2. public void focusGained(java.awt.event.FocusEvent evt) {
  3. formFocusGained(evt);

代码示例来源:origin: marytts/marytts

  1. cbSelected.addFocusListener(new java.awt.event.FocusAdapter() {
  2. public void focusGained(java.awt.event.FocusEvent evt) {
  3. formFocusGained(evt);

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

  1. private void initComponents() {
  2. setLayout(new GridBagLayout());
  3. textField = new JTextField();
  4. textField.getDocument().addDocumentListener(this);
  5. textField.addFocusListener(this);
  6. textField.setPreferredSize(new Dimension(100, textField.getPreferredSize().height));
  7. add(textField, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
  8. foreverCheckBox = new JCheckBox();
  9. Mnemonics.setLocalizedText(foreverCheckBox, NbBundle.getMessage(PropertyEditorGaugeMaxValue.class, "LBL_MAX_VALUE_INDEFINITE")); // NOI18N
  10. foreverCheckBox.addActionListener(this);
  11. foreverCheckBox.addFocusListener(this);
  12. add(foreverCheckBox, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));
  13. add(new JPanel(), new GridBagConstraints(2, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
  14. }

代码示例来源:origin: tflobbe/solrmeter

  1. protected Component getVisualComponent() {
  2. checkBox = new JCheckBox();
  3. this.setSelectedValue(SolrMeterConfiguration.getProperty(property));
  4. checkBox.addFocusListener(this);
  5. return checkBox;
  6. }

代码示例来源:origin: threerings/narya

  1. public BooleanFieldEditor (PresentsContext ctx, Field field, DObject object)
  2. {
  3. super(ctx, field, object);
  4. JPanel jpan = new JPanel(new HGroupLayout(HGroupLayout.STRETCH));
  5. // add a checkbox to display the field value
  6. jpan.add(_value = new JCheckBox(), GroupLayout.FIXED);
  7. // add a spacer so that clicks to the right of the checkbox
  8. // don't toggle it
  9. jpan.add(new Spacer(1, 1));
  10. _value.addActionListener(this);
  11. add(jpan);
  12. // we want to let the user know if they remove focus from a text
  13. // box without changing a field that it's not saved
  14. _value.addFocusListener(this);
  15. }

代码示例来源:origin: senbox-org/snap-desktop

  1. private void createCellDefaultValueCheckBox(FocusListener focusListener) {
  2. this.cellDefaultValueCheckBox = new JCheckBox();
  3. this.cellDefaultValueCheckBox.setBackground(Color.white);
  4. this.cellDefaultValueCheckBox.setOpaque(true);
  5. this.cellDefaultValueCheckBox.setVisible(false);
  6. this.cellDefaultValueCheckBox.addFocusListener(focusListener);
  7. }

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

  1. private void initComponents() {
  2. setLayout(new BorderLayout());
  3. foreverCheckBox = new JCheckBox();
  4. foreverCheckBox.addActionListener(this);
  5. foreverCheckBox.addFocusListener(this);
  6. Mnemonics.setLocalizedText(foreverCheckBox, NbBundle.getMessage(PropertyEditorTimeout.class, "LBL_TIMEOUTPE_FOREVER")); // NOI18N
  7. add(foreverCheckBox, BorderLayout.NORTH);
  8. foreverCheckBox.getAccessibleContext().setAccessibleName(
  9. NbBundle.getMessage(PropertyEditorTimeout.class,
  10. "ACSN_TIMEOUTPE_FOREVER")); // NOI18N
  11. foreverCheckBox.getAccessibleContext().setAccessibleDescription(
  12. NbBundle.getMessage(PropertyEditorTimeout.class,
  13. "ACSD_TIMEOUTPE_FOREVER")); // NOI18N
  14. textField = new JTextField();
  15. textField.getDocument().addDocumentListener(this);
  16. textField.addFocusListener(this);
  17. add(textField, BorderLayout.SOUTH);
  18. textField.getAccessibleContext().setAccessibleName(
  19. NbBundle.getMessage(PropertyEditorTimeout.class,
  20. "ACSN_TIMEOUTPE_VALUE")); // NOI18N
  21. textField.getAccessibleContext().setAccessibleDescription(
  22. NbBundle.getMessage(PropertyEditorTimeout.class,
  23. "ACSD_TIMEOUTPE_VALUE")); // NOI18N
  24. }

代码示例来源:origin: Slowpoke101/FTBLaunch

  1. mcWindowPosX.addFocusListener(settingsChangeListener);
  2. mcWindowPosY.addFocusListener(settingsChangeListener);
  3. autoMaxCheck.addFocusListener(settingsChangeListener);
  4. snooper.addFocusListener(settingsChangeListener);
  5. debugLauncherVerbose.addFocusListener(settingsChangeListener);
  6. betaChannel.addFocusListener(settingsChangeListener);
  7. exit.addActionListener(new ActionListener() {
  8. @Override

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

  1. private void initComponents() {
  2. setLayout(new BorderLayout());
  3. unlockedCheckBox = new JCheckBox();
  4. unlockedCheckBox.addActionListener(this);
  5. unlockedCheckBox.addFocusListener(this);
  6. Mnemonics.setLocalizedText(unlockedCheckBox, NbBundle.getMessage(PropertyEditorPreferredSize.class, "LBL_PREF_SIZE_UNLOCKED")); // NOI18N
  7. unlockedCheckBox.getAccessibleContext().setAccessibleName(
  8. NbBundle.getMessage(PropertyEditorPreferredSize.class,
  9. "ACSN_PREF_SIZE_UNLOCKED"));
  10. unlockedCheckBox.getAccessibleContext().setAccessibleDescription(
  11. NbBundle.getMessage(PropertyEditorPreferredSize.class,
  12. "ACSD_PREF_SIZE_UNLOCKED"));
  13. add(unlockedCheckBox, BorderLayout.NORTH);
  14. textField = new JTextField();
  15. textField.getAccessibleContext().setAccessibleName(
  16. radioButton.getAccessibleContext().getAccessibleName());
  17. textField.getAccessibleContext().setAccessibleDescription(
  18. radioButton.getAccessibleContext().getAccessibleDescription());
  19. textField.getDocument().addDocumentListener(this);
  20. textField.addFocusListener(this);
  21. add(textField, BorderLayout.SOUTH);
  22. }

代码示例来源:origin: de.dfki.mary/marytts-runtime

  1. cbSelected.addFocusListener(new java.awt.event.FocusAdapter() {
  2. public void focusGained(java.awt.event.FocusEvent evt) {
  3. formFocusGained(evt);

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

  1. cb1.addFocusListener(new java.awt.event.FocusAdapter() {
  2. public void focusGained(java.awt.event.FocusEvent evt) {
  3. cb1FocusGained(evt);
  4. cb2.addFocusListener(new java.awt.event.FocusAdapter() {
  5. public void focusGained(java.awt.event.FocusEvent evt) {
  6. cb2FocusGained(evt);
  7. cb3.addFocusListener(new java.awt.event.FocusAdapter() {
  8. public void focusGained(java.awt.event.FocusEvent evt) {
  9. cb3FocusGained(evt);
  10. cb4.addFocusListener(new java.awt.event.FocusAdapter() {
  11. public void focusGained(java.awt.event.FocusEvent evt) {
  12. cb4FocusGained(evt);
  13. cb5.setToolTipText(org.openide.util.NbBundle.getBundle(ListenerVisualPanel.class).getString("TTT_requestListener_short")); // NOI18N
  14. cb5.setMargin(new java.awt.Insets(0, 2, 0, 2));
  15. cb5.addFocusListener(new java.awt.event.FocusAdapter() {
  16. public void focusGained(java.awt.event.FocusEvent evt) {
  17. cb5FocusGained(evt);
  18. cb6.setToolTipText(org.openide.util.NbBundle.getBundle(ListenerVisualPanel.class).getString("TTT_requestAttrListener_short")); // NOI18N
  19. cb6.setMargin(new java.awt.Insets(0, 2, 0, 2));
  20. cb6.addFocusListener(new java.awt.event.FocusAdapter() {
  21. public void focusGained(java.awt.event.FocusEvent evt) {
  22. cb6FocusGained(evt);

代码示例来源:origin: MegaMek/megamek

  1. checkboxes1[0].addFocusListener(new FocusListener() {
  2. public void focusGained(FocusEvent e) {
  3. butOK.requestFocus();

代码示例来源:origin: Slowpoke101/FTBLaunch

  1. chckbxShowConsole.addFocusListener(settingsChangeListener);
  2. chckbxShowConsole.setSelected(settings.getConsoleActive());
  3. chckbxShowConsole.setBounds(540, 95, 183, 25);
  4. keepLauncherOpen.setBounds(540, 130, 300, 25);
  5. keepLauncherOpen.setSelected(settings.getKeepLauncherOpen());
  6. keepLauncherOpen.addFocusListener(settingsChangeListener);
  7. fitterPane.add(keepLauncherOpen);
  8. optJavaArgs.setBounds(540, 165, 300, 25);
  9. optJavaArgs.setSelected(settings.getOptJavaArgs());
  10. optJavaArgs.addFocusListener(settingsChangeListener);
  11. fitterPane.add(optJavaArgs);
  12. useSystemProxy.setBounds(540, 200, 300, 25);
  13. useSystemProxy.setSelected(settings.getUseSystemProxy());
  14. useSystemProxy.addFocusListener(settingsChangeListener);
  15. fitterPane.add(useSystemProxy);

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

  1. enableDirectoryDeployment.addFocusListener(new java.awt.event.FocusAdapter() {
  2. public void focusGained(java.awt.event.FocusEvent evt) {
  3. directoryDeploymentHelp(evt);
  4. enableDriverDeployment.addFocusListener(new java.awt.event.FocusAdapter() {
  5. public void focusGained(java.awt.event.FocusEvent evt) {
  6. jdbcDriverDeploymentHelp(evt);
  7. enableDatabaseStart.addFocusListener(new java.awt.event.FocusAdapter() {
  8. public void focusGained(java.awt.event.FocusEvent evt) {
  9. enableDatabaseStartHelp(evt);

代码示例来源:origin: igvteam/igv

  1. normalizeCoverageCB.addFocusListener(new FocusAdapter() {
  2. @Override
  3. public void focusLost(FocusEvent e) {
  4. showDatarangeCB.addFocusListener(new FocusAdapter() {
  5. @Override
  6. public void focusLost(FocusEvent e) {

相关文章

JCheckBox类方法