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

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

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

JButton.requestFocus介绍

暂无

代码示例

代码示例来源:origin: wiztools/rest-client

@Override
public void requestFocus() {
  jb_body_content_type.requestFocus();
}

代码示例来源:origin: wiztools/rest-client

void showMessage(final String title, final String message){
  messageDialog.setTitle(title);
  jta_error.setText(message);
  jta_error.setCaretPosition(0);
  messageDialog.setLocationRelativeTo(ui.getFrame());
  jb_ok.requestFocus();
  messageDialog.setVisible(true);
}

代码示例来源:origin: wiztools/rest-client

jb_ok.requestFocus();

代码示例来源:origin: wiztools/rest-client

jb_file.requestFocus();

代码示例来源:origin: kiegroup/optaplanner

private void setSolvingState(boolean solving) {
  quickOpenUnsolvedJList.setEnabled(!solving);
  quickOpenSolvedJList.setEnabled(!solving);
  if (solutionBusiness.hasImporter()) {
    importAction.setEnabled(!solving);
  }
  openAction.setEnabled(!solving);
  saveAction.setEnabled(!solving);
  if (solutionBusiness.hasExporter()) {
    exportAction.setEnabled(!solving);
  }
  solveAction.setEnabled(!solving);
  solveButton.setVisible(!solving);
  terminateSolvingEarlyAction.setEnabled(solving);
  terminateSolvingEarlyButton.setVisible(solving);
  if (solving) {
    terminateSolvingEarlyButton.requestFocus();
  } else {
    solveButton.requestFocus();
  }
  solutionPanel.setEnabled(!solving);
  progressBar.setIndeterminate(solving);
  progressBar.setStringPainted(solving);
  progressBar.setString(solving ? "Solving..." : null);
  indictmentHeatMapToggleButton.setEnabled(solutionPanel.isIndictmentHeatMapEnabled() && !solving);
  showConstraintMatchesDialogAction.setEnabled(!solving);
}

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

@Override
public void requestFocus() {
  this.btnRight.requestFocus();
}

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

downloadButton.requestFocus();
downloadButton.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {

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

case 1:
  versionStr = "1";
  btnPreviousConfiguration1.requestFocus();
  break;
case 2:
  versionStr = "2";
  btnPreviousConfiguration2.requestFocus();
  break;
default:

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

if (currentSettingVersion == 1) {
  versionStr = "1";
  btnSavedConfiguration1.requestFocus();
} else if (currentSettingVersion == 2) {
  versionStr = "2";
  btnSavedConfiguration2.requestFocus();
} else {
  btnSavedConfiguration2.getParent().requestFocus();

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

private void requestFocusIfPossible() {
  boolean requestFocusAllowed = true;
  if (MageFrame.getInstance().getFocusOwner() == null) {
    requestFocusAllowed = false;
  } else if (connectedChatPanel != null && connectedChatPanel.getTxtMessageInputComponent() != null) {
    if (connectedChatPanel.getTxtMessageInputComponent().hasFocus()) {
      requestFocusAllowed = false;
    }
  }
  if (requestFocusAllowed) {
    this.btnRight.requestFocus();
    this.helper.requestFocus();
  }
}

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

setBounds(org.openide.util.Utilities.findCenterBounds(getSize()));
buttonClose.requestFocus(); // to get shortcuts to work

代码示例来源:origin: kaikramer/keystore-explorer

@Override
  public void run() {
    jbOK.requestFocus();
  }
});

代码示例来源:origin: kaikramer/keystore-explorer

@Override
  public void run() {
    jbOK.requestFocus();
  }
});

代码示例来源:origin: kaikramer/keystore-explorer

@Override
  public void run() {
    jbOK.requestFocus();
  }
});

代码示例来源:origin: kaikramer/keystore-explorer

@Override
  public void run() {
    jbOK.requestFocus();
  }
});

代码示例来源:origin: kaikramer/keystore-explorer

@Override
  public void run() {
    jbOK.requestFocus();
  }
});

代码示例来源:origin: kaikramer/keystore-explorer

@Override
  public void run() {
    jbOK.requestFocus();
  }
});

代码示例来源:origin: kaikramer/keystore-explorer

@Override
  public void run() {
    jbOK.requestFocus();
  }
});

代码示例来源:origin: stackoverflow.com

public NewJFrame() {
  initComponents();
  rootPane= getRootPane();
  container=getContentPane();
  setSize(Toolkit.getDefaultToolkit().getScreenSize());
  setVisible(true);

  //added code:
  JButton jbutton5 = //get from NewJPanel1
  getRootPane().setDefaultButton(jbutton5);
  jbutton5.requestFocus();
}

代码示例来源:origin: danfickle/openhtmltopdf

public void actionPerformed(ActionEvent e) {
    if (e.getSource() == _browseButton) {
      JFileChooser chooser = new JFileChooser();
      
      // TODO: We should probably use the BasicPanel as the parent
      int result = chooser.showOpenDialog(_browseButton);
      
      if (result == JFileChooser.APPROVE_OPTION) {
        _pathTextField.setText(chooser.getSelectedFile().getAbsolutePath());
        _pathTextField.setCaretPosition(0);
        
        _browseButton.requestFocus();
      }
    }
  }
}

相关文章

JButton类方法