javax.swing.JButton.isEnabled()方法的使用及代码示例

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

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

JButton.isEnabled介绍

暂无

代码示例

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

public void mouseClicked (MouseEvent evt) {
    if (evt.getClickCount() == 2 && addEffectButton.isEnabled()) addEffectButton.doClick();
  }
});

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

public void mouseClicked (MouseEvent evt) {
    if (evt.getClickCount() == 2 && addEffectButton.isEnabled()) addEffectButton.doClick();
  }
});

代码示例来源:origin: stanfordnlp/CoreNLP

private void addToHistoryList(String pattern, int numTreesMatched, int numMatches) {
 if(!historyButton.isEnabled()) {
  historyButton.setEnabled(true);
  TregexGUI.getInstance().setSaveHistoryEnabled(true);
 }
 historyList.add(new HistoryEntry(pattern, numTreesMatched, numMatches));
}

代码示例来源:origin: stanfordnlp/CoreNLP

/**
 * Finds the sentence delimited by the closest sentence delimiter preceding
 * start and closest period following end.  If end is less than start
 * (or -1), sets right boundary as closest period following start.
 * Actually starts search for preceding sentence delimiter at (start-1)
 */
private void highlightSentence(int start, int end) {
 // clears highlight.  paints over entire document because the document may have changed
 highlightText(0, textPane.getText().length(), normalStyle);
 // if start<1 set startIndex to 0, otherwise set to index following closest preceding period
 startIndex = (start < 1) ? 0 : nearestDelimiter(textPane.getText(), start, SEEK_BACK) + 1;
 // if end<startIndex, set endIndex to closest period following startIndex
 // else, set it to closest period following end
 endIndex = nearestDelimiter(textPane.getText(), (end < startIndex) ? startIndex : end, SEEK_FORWARD);
 if (endIndex == -1) {
  endIndex = textPane.getText().length() - 1;
 }
 highlightText(startIndex, endIndex, highlightStyle);
 // enable/disable scroll buttons as necessary
 backButton.setEnabled(startIndex != 0);
 forwardButton.setEnabled(endIndex != textPane.getText().length() - 1);
 parseNextButton.setEnabled(forwardButton.isEnabled() && parser != null);
}

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

public Boolean isNextEnabled() {
  return nextButton == null ? null : nextButton.isEnabled();
}

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

final boolean isNextEnabled() {
  return nextButton.isEnabled();
}

代码示例来源:origin: Nilhcem/FakeSMTP

/**
   * Enables the button, so that the user can clear/delete emails.
   * <p>
   * This method will be called by a {@link MailSaver} object when an email will be received.
   * </p>
   */
  @Override
  public void update(Observable o, Object arg) {
    if (o instanceof MailSaver && !button.isEnabled()) {
      button.setEnabled(true);
    }
  }
}

代码示例来源:origin: winder/Universal-G-Code-Sender

public boolean isKeyboardMovementEnabled() {
  return keyboardMovementEnabled.isSelected() && xPlusButton.isEnabled();
}

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

/**
 * Cancels the wizard - if Cancel button is enabled.
 * Always call this method from EDT thread.
 * @since 7.19
 */
public final void doCancelClick() {
  assert SwingUtilities.isEventDispatchThread();
  if (cancelButton.isEnabled()) {
    cancelButton.doClick();
  }
}

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

public void setFinishEnabled(Boolean isEnabled) {
  Boolean oldValue = finishButton.isEnabled();
  if (!isEnabled.equals(oldValue)) {
    firePropertyChange("isFinishEnabled", oldValue, isEnabled);
    finishButton.setEnabled(isEnabled);
  }
}

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

public void setCancelEnabled(Boolean isEnabled) {
  Boolean oldValue = cancelButton.isEnabled();
  if (!isEnabled.equals(oldValue)) {
    firePropertyChange("isCancelEnabled", oldValue, isEnabled);
    cancelButton.setEnabled(isEnabled);
  }
}

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

@Override
  public void run () {
    if (nextButton.isEnabled () || finishButton.isEnabled ()) {
      wizardPanel.setMessage(WizardPanel.MSG_TYPE_WARNING, (String) ((value == null) ? "" : value));
    } else {
      wizardPanel.setMessage(WizardPanel.MSG_TYPE_ERROR, (String) ((value == null) ? "" : value));
    }
  }
});

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

/**
 * Moves the wizard to its previous panel - if Previous button is enabled.
 * Always call this method from EDT thread.
 * @since 7.19
 */
public final void doPreviousClick() {
  assert SwingUtilities.isEventDispatchThread();
  if (previousButton.isEnabled()) {
    previousButton.doClick();
  }
}

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

/**
 * Finishes the wizard - if Finish button is enabled.
 * Always call this method from EDT thread.
 * @since 7.19
 */
public final void doFinishClick() {
  assert SwingUtilities.isEventDispatchThread();
  if (finishButton.isEnabled()) {
    finishButton.doClick();
  }
}

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

public void setNextEnabled(Boolean isEnabled) {
  Boolean oldValue = nextButton.isEnabled();
  if (!isEnabled.equals(oldValue)) {
    firePropertyChange("isNextEnabled", oldValue, isEnabled);
    nextButton.setEnabled(isEnabled);
  }
}

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

public void setBackEnabled(Boolean isEnabled) {
  Boolean oldValue = backButton.isEnabled();
  if (!isEnabled.equals(oldValue)) {
    firePropertyChange("isBackEnabled", oldValue, isEnabled);
    backButton.setEnabled(isEnabled);
  }
}

代码示例来源:origin: ron190/jsql-injection

@Override public void mouseExited(MouseEvent e) {
  if (this.buttonFlat.isEnabled() && !this.isVisible) {
    this.buttonFlat.setContentAreaFilled(false);
    this.buttonFlat.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
  }
}

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

/**
 * Moves the wizard to its next panel - if Next button is enabled.
 * Always call this method from EDT thread.
 * @since 7.19
 */
public final void doNextClick() {
  assert SwingUtilities.isEventDispatchThread();
  if (nextButton.isEnabled()) {
    nextButton.doClick();
  }
}

代码示例来源:origin: ron190/jsql-injection

@Override public void mouseEntered(MouseEvent e) {
  if (this.buttonFlat.isEnabled() && !this.isVisible) {
    this.buttonFlat.setContentAreaFilled(true);
    this.buttonFlat.setBorder(HelperUi.BORDER_ROUND_BLU);
  }
}

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

public void doClick(MageComponents name, int waitBeforeClick) throws InterruptedException {
    final JButton j = getButton(name);
    TimeUnit.MILLISECONDS.sleep(waitBeforeClick);
    while (!j.isEnabled()) {
      TimeUnit.MILLISECONDS.sleep(10);
    }
    Thread t = new Thread(() -> j.doClick());
    t.start();
  }
}

相关文章

JButton类方法