本文整理了Java中javax.swing.JTextField.transferFocus()
方法的一些代码示例,展示了JTextField.transferFocus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextField.transferFocus()
方法的具体详情如下:
包路径:javax.swing.JTextField
类名称:JTextField
方法名:transferFocus
暂无
代码示例来源:origin: org.tentackle/tentackle-swing
/**
* {@inheritDoc}
* <p>
* Ovwerwritten to set transferFocusDone.
*/
@Override
public void transferFocus() {
transferFocusDone = true;
super.transferFocus();
}
代码示例来源:origin: com.synaptix/SynaptixWidget
button.setFocusable(false);
nameField.transferFocus();
代码示例来源:origin: ontop/ontop
private void txtRowCountKeyPressed(java.awt.event.KeyEvent evt) {// GEN-FIRST:event_txtRowCountKeyPressed
int code = evt.getKeyCode();
if (code == KeyEvent.VK_ENTER) {
txtRowCount.transferFocus();
}
}// GEN-LAST:event_txtRowCountKeyPressed
代码示例来源:origin: superzanti/ServerSync
@Override
public void keyReleased(java.awt.event.KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_TAB) {
TF_ipAddress.transferFocus();
}
}
代码示例来源:origin: org.ostermiller/utils
public void actionPerformed(ActionEvent e){
Object source = e.getSource();
if (source == name){
// the user pressed enter in the name field.
name.transferFocus();
} else {
// other actions close the dialog.
pressed_OK = (source == pass || source == okButton);
PasswordDialog.this.setVisible(false);
}
}
};
代码示例来源:origin: ontop/ontop
@Override
public void keyPressed(KeyEvent e) {
String text = tf.getText();
int code = e.getKeyCode();
if (code == KeyEvent.VK_ESCAPE) {
hideFlag = true;
} else if (code == KeyEvent.VK_RIGHT) {
for (int i = 0; i < items.size(); i++) {
Object element = items.elementAt(i);
String value = element.toString();
if (value.startsWith(text)) {
if (value.contains(":") && !text.contains(":")) {
/* if the suggested string contains a prefix label and
* the input text doesn't contain any prefix label then
* auto-complete the prefix label. */
tf.setText(value.substring(0, value.indexOf(":") + 1));
}
return;
}
}
} else if (code == KeyEvent.VK_ENTER) {
tf.transferFocus();
hideFlag = true;
}
}
});
代码示例来源:origin: tulskiy/musique
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_DOWN) {
searchField.transferFocus();
if (!view.isEmpty())
table.setRowSelectionInterval(0, 0);
} else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
hideDialog();
}
}
});
代码示例来源:origin: stackoverflow.com
if (dot >= maxSize) {
fb.setDot(0, bias);
field.transferFocus();
return;
if (dot >= maxSize) {
fb.setDot(0, bias);
field.transferFocus();
return;
代码示例来源:origin: Killerardvark/CryodexSource
@Override
public void actionPerformed(ActionEvent arg0) {
CryodexController.getPlayers().remove(getPlayerList().getSelectedValue());
getUserModel().removeElement(getPlayerList().getSelectedValue());
clearFields();
CryodexController.saveData();
updateCounterLabel();
// Fix to prevent the filter textbox from stealing focus after a delete
playerSearchField.transferFocus();
}
代码示例来源:origin: GoldenGnu/jeveassets
@Override
public void actionPerformed(final ActionEvent e) {
if (AccountCellAction.ACCOUNT_NAME.name().equals(e.getActionCommand())) {
OwnerType owner = (OwnerType) currentSeparator.first();
if (jAccountName.getText().isEmpty()) {
owner.setResetAccountName();
} else {
owner.setAccountName(jAccountName.getText());
}
jAccountName.transferFocus();
accountManagerDialog.forceUpdate();
expandSeparator(true);
int index = jTable.getSelectedRow() + 1;
if (jTable.getRowCount() >= index) {
jTable.setRowSelectionInterval(index, index);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!