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

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

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

JTextField.requestFocus介绍

暂无

代码示例

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

@Override
  public void actionPerformed(ActionEvent ae) {
    try {
      final String localHost = InetAddress.getLocalHost().getHostName();
      jtf_workstation.setText(localHost);
      jtf_workstation.selectAll();
      jtf_workstation.requestFocus();
    }
    catch(UnknownHostException ex) {
      throw new RuntimeException(ex);
    }
  }
});

代码示例来源:origin: deathmarine/Luyten

public void showFindBox() {
  this.setVisible(true);
  this.textField.requestFocus();
  this.textField.selectAll();
}

代码示例来源:origin: skylot/jadx

@Override
protected void openInit() {
  prepare();
  String lastSearch = cache.getLastSearch();
  if (lastSearch != null) {
    searchField.setText(lastSearch);
    searchField.selectAll();
    searchEmitter.emitSearch();
  }
  searchField.requestFocus();
}

代码示例来源:origin: deathmarine/Luyten

public void showFindBox() {
  this.setVisible(true);
  this.textField.requestFocus();
}

代码示例来源:origin: skylot/jadx

public boolean toggle() {
  boolean visible = !isVisible();
  setVisible(visible);
  if (visible) {
    searchField.requestFocus();
    searchField.selectAll();
  } else {
    rTextArea.requestFocus();
  }
  return visible;
}

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

@Override
  public void actionPerformed(ActionEvent ae) {
    final String selected = (String) jcb_types.getSelectedItem();
    if(AuthHelper.isNone(selected)) {
      jsp.setViewportView(jp_none);
    }
    else if(AuthHelper.isBasicOrDigest(selected)) {
      jsp.setViewportView(jp_jsp_form);
      jtf_host.requestFocus();
    }
    else if(AuthHelper.isNtlm(selected)) {
      jsp.setViewportView(jp_jsp_ntlm);
      jtf_domain.requestFocus();
    }
    else if(AuthHelper.isBearer(selected)) {
      jsp.setViewportView(jp_jsp_oauth2_bearer);
      jtf_bearer_token.requestFocus();
    }
  }
});

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

@Override
  public void actionPerformed(ActionEvent arg0) {
    if(doesSelectedMethodSupportEntityBody()){
      view.enableBody();
    }
    else{
      view.disableBody();
    }
    
    if(jrb_req_custom.isSelected()) {
      jtf_custom.setEnabled(true);
      jtf_custom.requestFocus();
    }
    else {
      jtf_custom.setEnabled(false);
    }
  }
};

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

jtf_key.setText("");
jtf_value.setText("");
jtf_key.requestFocus();

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

"Validation: name empty!",
    JOptionPane.ERROR_MESSAGE);
jtf_name.requestFocus();
return false;
    "Validation: filename empty!",
    JOptionPane.ERROR_MESSAGE);
jtf_fileName.requestFocus();
return false;

代码示例来源:origin: zzz40500/GsonFormat

@Override
public void mouseClicked(MouseEvent mouseEvent) {
  super.mouseClicked(mouseEvent);
  cardLayout.next(generateClassP);
  if (generateClassLB.getText().equals(currentClass) && !TextUtils.isEmpty(Config.getInstant().getEntityPackName()) && !Config.getInstant().getEntityPackName().equals("null")) {
    generateClassLB.setText(Config.getInstant().getEntityPackName());
    generateClassTF.setText(Config.getInstant().getEntityPackName());
  }
  generateClassTF.requestFocus(true);
}

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

"Validation: name empty!",
      JOptionPane.ERROR_MESSAGE);
  jtf_name.requestFocus();
  return false;
jtf_name.requestFocus();

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

@Override
  public void mouseClicked(MouseEvent mouseEvent) {
    consolePrompt.requestFocus();
  }
});

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

public void focusGained(FocusEvent focusEvent) {
  consolePrompt.requestFocus();
}

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

@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
  if (this.table == null) {
    this.table = table;
  }
  currentOriginalHeigh = table.getRowHeight(row);
  currentRow = row;
  
  if (!valueSet) {
    spinner.setValue(value);
  }
  SwingUtilities.invokeLater(() -> textField.requestFocus());
  return spinner;
}

代码示例来源:origin: apache/pdfbox

public void reFocus()
{
  searchField.requestFocus();
  String searchKey = searchField.getText();
  searchField.setText(searchKey);
  searchField.setSelectionStart(0);
  searchField.setSelectionEnd(searchField.getText().length());
  closeAction.setEnabled(true);
}

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

private void showNumberField() {
  numberField.setText(valueAsString());
  numberField.setVisible(true);
  numberField.requestFocus();
  numberField.selectAll();
  componentResized(null);
  repaint();
}

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

textLabel.setLabelFor(textField);
textField.requestFocus();

代码示例来源:origin: i2p/i2p.i2p

private void constructUI() {
  JPanel c = (JPanel) getContentPane();
  c.setLayout(new BorderLayout(3, 3));
  c.add(topLabel, BorderLayout.NORTH);
  c.add(inputField, BorderLayout.WEST);
  c.add(convertButton, BorderLayout.CENTER);
  convertButton.setToolTipText(helpText);
  convertButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      convert();
    }
  });
  c.add(helpButton, BorderLayout.EAST);
  helpButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      JOptionPane.showMessageDialog(helpButton, helpText, "Epoch Help", JOptionPane.INFORMATION_MESSAGE);
    }
  });
  inputField.requestFocus();
  getRootPane().setDefaultButton(convertButton);
  setResizable(false);
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  pack();
  centerOnScreen();
  setVisible(true);
}

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

consolePrompt.requestFocus();
addFocusListener(this);
addWindowListener(this);

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

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

相关文章

JTextField类方法