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

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

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

JTextField.requestFocusInWindow介绍

暂无

代码示例

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

private void updateNameActions(boolean saveAndCancel)
{
  save.setVisible(saveAndCancel);
  cancel.setVisible(saveAndCancel);
  rename.setVisible(!saveAndCancel);
  if (saveAndCancel)
  {
    nameInput.getTextField().requestFocusInWindow();
    nameInput.getTextField().selectAll();
  }
}

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

mainFrame.setVisible(true);
txtField.setFocusable(true);
txtField.requestFocusInWindow();
txtField.setToolTipText("type and then press enter to send");
txtField.addActionListener(e -> {

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

SkillCalculator(Client client, UICalculatorInputArea uiInput, SpriteManager spriteManager, ItemManager itemManager)
{
  this.client = client;
  this.uiInput = uiInput;
  this.spriteManager = spriteManager;
  this.itemManager = itemManager;
  combinedActionSlot = new UICombinedActionSlot(spriteManager);
  searchBar.setIcon(IconTextField.Icon.SEARCH);
  searchBar.setPreferredSize(new Dimension(PluginPanel.PANEL_WIDTH - 20, 30));
  searchBar.setBackground(ColorScheme.DARKER_GRAY_COLOR);
  searchBar.setHoverBackgroundColor(ColorScheme.DARK_GRAY_HOVER_COLOR);
  searchBar.addKeyListener(e -> onSearch());
  setLayout(new DynamicGridLayout(0, 1, 0, 5));
  // Register listeners on the input fields and then move on to the next related text field
  uiInput.getUiFieldCurrentLevel().addActionListener(e ->
  {
    onFieldCurrentLevelUpdated();
    uiInput.getUiFieldTargetLevel().requestFocusInWindow();
  });
  uiInput.getUiFieldCurrentXP().addActionListener(e ->
  {
    onFieldCurrentXPUpdated();
    uiInput.getUiFieldTargetXP().requestFocusInWindow();
  });
  uiInput.getUiFieldTargetLevel().addActionListener(e -> onFieldTargetLevelUpdated());
  uiInput.getUiFieldTargetXP().addActionListener(e -> onFieldTargetXPUpdated());
}

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

@Override
public void actionPerformed(ActionEvent e) {
  this.panelSearch.setVisible(true);
  this.textFilter.requestFocusInWindow();
}

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

@Override
public void keyPressed(KeyEvent e) {
  AbstractNodeModel nodeModel = (AbstractNodeModel) currentNode.getUserObject();
  if (e.getKeyCode() == KeyEvent.VK_F2 && !nodeModel.isRunning()) {
    nodeModel.setIsEdited(true);
    
    PanelNode.this.label.setVisible(false);
    PanelNode.this.textFieldEditable.setVisible(true);
    PanelNode.this.textFieldEditable.requestFocusInWindow();
    
    tree.revalidate();
    tree.repaint();
  }
}

代码示例来源:origin: org.ihtsdo/wb-api

@Override
  protected void finalSetup() {
    fullName.requestFocusInWindow();
  }
}

代码示例来源:origin: org.scijava/ui-behaviour

@Override
public boolean requestFocusInWindow()
{
  return textField.requestFocusInWindow();
}

代码示例来源:origin: protegeproject/protege

@Override
  public void windowOpened(WindowEvent e) {
    searchDialogPanel.searchField.requestFocusInWindow();
    searchDialogPanel.searchField.selectAll();
  }
});

代码示例来源:origin: zheludkovm/LinuxJavaFixes

/** Handle the button click. */
public void actionPerformed(ActionEvent e) {
  //Clear the text components.
  displayArea.setText("");
  typingArea.setText("");
  //Return the focus to the typing area.
  typingArea.requestFocusInWindow();
}

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

MediatorGui.panelAddressBar().getTextFieldAddress().requestFocusInWindow();
MediatorGui.panelAddressBar().getTextFieldAddress().selectAll();
this.wasAltDPressed[0] = true;

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

public void itemStateChanged(final ItemEvent e) {
    final boolean selected = e.getStateChange() == ItemEvent.SELECTED;
    userZoom.setEditable(selected);
    userZoom.setEnabled(selected);
    if (selected) {
      userZoom.requestFocusInWindow();
    }
  }
});

代码示例来源:origin: net.sf.squirrel-sql.plugins/firebirdmanager

public void setFocusToFirstEmptyInputField() {
  if (jtextfieldServer.getText().length() == 0) {
    jtextfieldServer.requestFocusInWindow();
  } else if (jtextfieldPort.getText().length() == 0) {
    jtextfieldPort.requestFocusInWindow();
  } else if (jtextfieldManagerUsername.getText().length() == 0) {
    jtextfieldManagerUsername.requestFocusInWindow();
  } else {
    jpasswordfieldManager.requestFocusInWindow();
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-utils

@Override
public void addNotify() {
  super.addNotify();
  itemField.requestFocusInWindow();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api

@Override
public void addNotify () {
  super.addNotify();
  fileTextField.requestFocusInWindow();
}

代码示例来源:origin: net.sf.squirrel-sql.plugins/firebirdmanager

public void setFocusToFirstEmptyInputField() {
  if (jtextfieldUsername.getText().length() == 0) {
    jtextfieldUsername.requestFocusInWindow();
  } else {
    jpasswordfieldPW.requestFocusInWindow();
  }
}

代码示例来源:origin: Multibit-Legacy/multibit-hd

@Override
public void afterShow() {
 hardwareLabel.setText(getWizardModel().getTrezorWalletLabel());
 hardwareLabel.selectAll();
 hardwareLabel.requestFocusInWindow();
}

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

public Set<String> showDialog() {
  channels.setText("");
  join = false;
  changed();
  channels.requestFocusInWindow();
  setVisible(true);
  if (!join) {
    channels.setText("");
  }
  return getChannels();
}

代码示例来源:origin: otros-systems/otroslogviewer

private void startEditing() {
 editor.setVisible(true);
 editor.setText(label.getText());
 editor.selectAll();
 len = editor.getText().length();
 dim = editor.getPreferredSize();
 editor.setMinimumSize(dim);
 remove(label);
 add(editor, 0);
 revalidate();
 editor.requestFocusInWindow();
}

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

public void addCustomInput() {
  add(customReasonInput, customInputGbc);
  revalidate();
  customReasonInput.requestFocusInWindow();
  customReasonInput.setSelectionStart(0);
  customReasonInput.setSelectionEnd(customReasonInput.getText().length());
}

代码示例来源:origin: org.jspresso.framework/jspresso-swing-components

@Override
 public void focusGained(FocusEvent e) {
  if (!e.isTemporary()) {
   JTextField tf = ((DateField) e.getSource()).getFormattedTextField();
   tf.requestFocusInWindow();
  }
 }
});

相关文章

JTextField类方法