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

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

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

JButton.isEnabled介绍

暂无

代码示例

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1. /**
  2. * Cancels the wizard - if Cancel button is enabled.
  3. * Always call this method from EDT thread.
  4. * @since 7.19
  5. */
  6. public final void doCancelClick() {
  7. assert SwingUtilities.isEventDispatchThread();
  8. if (cancelButton.isEnabled()) {
  9. cancelButton.doClick();
  10. }
  11. }

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

  1. public void setFinishEnabled(Boolean isEnabled) {
  2. Boolean oldValue = finishButton.isEnabled();
  3. if (!isEnabled.equals(oldValue)) {
  4. firePropertyChange("isFinishEnabled", oldValue, isEnabled);
  5. finishButton.setEnabled(isEnabled);
  6. }
  7. }

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

  1. public void setCancelEnabled(Boolean isEnabled) {
  2. Boolean oldValue = cancelButton.isEnabled();
  3. if (!isEnabled.equals(oldValue)) {
  4. firePropertyChange("isCancelEnabled", oldValue, isEnabled);
  5. cancelButton.setEnabled(isEnabled);
  6. }
  7. }

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

  1. @Override
  2. public void run () {
  3. if (nextButton.isEnabled () || finishButton.isEnabled ()) {
  4. wizardPanel.setMessage(WizardPanel.MSG_TYPE_WARNING, (String) ((value == null) ? "" : value));
  5. } else {
  6. wizardPanel.setMessage(WizardPanel.MSG_TYPE_ERROR, (String) ((value == null) ? "" : value));
  7. }
  8. }
  9. });

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

  1. /**
  2. * Moves the wizard to its previous panel - if Previous button is enabled.
  3. * Always call this method from EDT thread.
  4. * @since 7.19
  5. */
  6. public final void doPreviousClick() {
  7. assert SwingUtilities.isEventDispatchThread();
  8. if (previousButton.isEnabled()) {
  9. previousButton.doClick();
  10. }
  11. }

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

  1. /**
  2. * Finishes the wizard - if Finish button is enabled.
  3. * Always call this method from EDT thread.
  4. * @since 7.19
  5. */
  6. public final void doFinishClick() {
  7. assert SwingUtilities.isEventDispatchThread();
  8. if (finishButton.isEnabled()) {
  9. finishButton.doClick();
  10. }
  11. }

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

  1. public void setNextEnabled(Boolean isEnabled) {
  2. Boolean oldValue = nextButton.isEnabled();
  3. if (!isEnabled.equals(oldValue)) {
  4. firePropertyChange("isNextEnabled", oldValue, isEnabled);
  5. nextButton.setEnabled(isEnabled);
  6. }
  7. }

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

  1. public void setBackEnabled(Boolean isEnabled) {
  2. Boolean oldValue = backButton.isEnabled();
  3. if (!isEnabled.equals(oldValue)) {
  4. firePropertyChange("isBackEnabled", oldValue, isEnabled);
  5. backButton.setEnabled(isEnabled);
  6. }
  7. }

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

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

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

  1. /**
  2. * Moves the wizard to its next panel - if Next button is enabled.
  3. * Always call this method from EDT thread.
  4. * @since 7.19
  5. */
  6. public final void doNextClick() {
  7. assert SwingUtilities.isEventDispatchThread();
  8. if (nextButton.isEnabled()) {
  9. nextButton.doClick();
  10. }
  11. }

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

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

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

  1. public void doClick(MageComponents name, int waitBeforeClick) throws InterruptedException {
  2. final JButton j = getButton(name);
  3. TimeUnit.MILLISECONDS.sleep(waitBeforeClick);
  4. while (!j.isEnabled()) {
  5. TimeUnit.MILLISECONDS.sleep(10);
  6. }
  7. Thread t = new Thread(() -> j.doClick());
  8. t.start();
  9. }
  10. }

相关文章

JButton类方法