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

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

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

JTextArea.requestFocus介绍

暂无

代码示例

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

@Override
public void setVisible(boolean boo){
  super.setVisible(boo);
  if(boo == true){
    jta_in.requestFocus();
  }
}

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

jta_in.requestFocus();

代码示例来源:origin: org.codehaus.groovy/groovy

public void actionPerformed(ActionEvent ae) {
  Token token = (Token) ((JComponent) ae.getSource()).getClientProperty("token");
  if (token.getType() == Token.EOF_TYPE) {
    scriptPane.select(0, 0);
    return;
  }
  try {
    int start = scriptPane.getLineStartOffset(token.getLine() - 1) + token.getColumn() - 1;
    scriptPane.select(start, start + token.getText().length());
    scriptPane.requestFocus();
  } catch (BadLocationException ex) {
    // IGNORE
  }
}

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

xpathQueryArea.requestFocus();

代码示例来源:origin: bobbylight/RSyntaxTextArea

/**
 * Disposes of the focusable tip currently displayed, if any.
 */
public void possiblyDisposeOfTipWindow() {
  if (tipWindow != null) {
    tipWindow.dispose();
    tipWindow = null;
    textAreaListener.uninstall();
    tipVisibleBounds.setBounds(-1, -1, 0, 0);
    lastText = null;
    textArea.requestFocus();
  }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * sets the focus in a designated control.
 */
public void setFocus() {
 m_TextQuery.requestFocus();
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * sets the focus in a designated control.
 */
public void setFocus() {
 m_TextQuery.requestFocus();
}

代码示例来源:origin: jaltekruse/OpenNotebook

@Override
public void focusAttributField() {
  textArea.requestFocus();
}

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

private void checkForTriggerEvent(final MouseEvent e) {
  if (e.isPopupTrigger()) {
    area.requestFocus();
    popmenu.show(e.getComponent(), e.getX(), e.getY());
  }
}

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

@Override
  public void displayingPanel() {
    super.displayingPanel();
    reasonTextArea.requestFocus();
  }
}

代码示例来源:origin: bcdev/beam

@Override
  public void actionPerformed(final ActionEvent e) {
    textArea.selectAll();
    textArea.requestFocus();
  }
});

代码示例来源:origin: org.gosu-lang.gosu/gosu-lab

public void show( Component invoker, int iX, int iY )
{
 super.show( invoker, iX, iY );
 EventQueue.invokeLater( () -> EventQueue.invokeLater( () -> {
  _field.requestFocus();
  _field.selectAll();
 } ) );
}

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

JTextArea area =...;

SwingUtilities.invokeLater(new Runnable() {
  public void run() {
   area.requestFocus();
  }
});

代码示例来源:origin: senbox-org/snap-desktop

public void undoLastEdit() {
  if (!undoBuffer.isEmpty()) {
    String code = undoBuffer.pop();
    setCode(code);
    updateUIState();
    codeArea.requestFocus();
  }
}

代码示例来源:origin: bcdev/beam

public void undoLastEdit() {
  if (!undoBuffer.isEmpty()) {
    String code = undoBuffer.pop();
    setCode(code);
    updateUIState();
    codeArea.requestFocus();
  }
}

代码示例来源:origin: eu.mihosoft.vrl/vrl

@Override
  public void actionPerformed(ActionEvent e) {
    if (e.getActionCommand().equals(CanvasWindow.ACTIVE_ACTION)) {
      tRep.getEditor().getEditor().requestFocus();
    }
    if (e.getActionCommand().equals(CanvasWindow.MAXIMIZE_ACTION)) {
      tRep.getEditor().getEditor().requestFocus();
    }
  }
});

代码示例来源:origin: eu.mihosoft.vrl/vrl

@Override
  public void actionPerformed(ActionEvent e) {
    if (e.getActionCommand().equals(CanvasWindow.ACTIVE_ACTION)) {
      getEditor().getEditor().requestFocus();
    }
    if (e.getActionCommand().equals(CanvasWindow.MAXIMIZE_ACTION)) {
      getEditor().getEditor().requestFocus();
    }
  }
});

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Positions and sizes the overlay.
 * @param r the bounding Rectangle2D.Double for the overlay
 * @param text the text to edit
 */
public void setBounds(Rectangle2D.Double r, String text) {
  textArea.setText(text);
  editScrollContainer.setBounds(view.drawingToView(r));
  editScrollContainer.setVisible(true);
  textArea.setCaretPosition(0);
  textArea.requestFocus();
}

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

void find() {
  FindDialog findDialog = new FindDialog(frame);
  if(findDialog.wasValidated()) {
    searchString = findDialog.getSearchString().toLowerCase();
    if(!searchString.equals(""))
      doSearch(0, true);
  }
  // Request the focus on the text area which could be lost after the Find dialog was disposed
  textArea.requestFocus();
}

代码示例来源:origin: org.jenkins-ci/executable-war

/**
   * Forces the scroll of text area.
   */
  private void scrollDown() {
    int pos = textArea.getDocument().getEndPosition().getOffset();
    textArea.getCaret().setDot(pos);
    textArea.requestFocus();
  }
}

相关文章

JTextArea类方法