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

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

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

JTextArea.select介绍

暂无

代码示例

代码示例来源:origin: bonnyfone/vectalign

@Override
  public void actionPerformed(ActionEvent e) {
    Utils.copyToClipboard(svgFromOutput.getText());
    svgFromOutput.select(0, svgFromOutput.getText().length());
  }
});

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

@Override
  public void actionPerformed(ActionEvent e)
  {
    console.selectAll();
    console.copy();
    console.select(0, 0);
  }
};

代码示例来源:origin: bonnyfone/vectalign

@Override
  public void actionPerformed(ActionEvent e) {
    Utils.copyToClipboard(svgToOutput.getText());
    svgToOutput.select(0, svgToOutput.getText().length());
  }
});

代码示例来源: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: ro.isdc.wro4j/rhino

/**
 * Selects a subrange of the text.
 */
@Override
public void select(int start, int end) {
  //requestFocus();
  super.select(start, end);
}

代码示例来源:origin: com.github.tntim96/rhino

/**
 * Selects a subrange of the text.
 */
@Override
public void select(int start, int end) {
  //requestFocus();
  super.select(start, end);
}

代码示例来源:origin: org.jvnet.hudson/embedded-rhino-debugger

/**
 * Selects a subrange of the text.
 */
@Override
public void select(int start, int end) {
  //requestFocus();
  super.select(start, end);
}

代码示例来源:origin: com.github.houbie/rhino-mod

/**
 * Selects a subrange of the text.
 */
@Override
public void select(int start, int end) {
  //requestFocus();
  super.select(start, end);
}

代码示例来源:origin: com.github.tntim96/rhino

@Override
public void select(int start, int end) {
  requestFocus();
  super.select(start, end);
}

代码示例来源:origin: ro.isdc.wro4j/rhino

@Override
public void select(int start, int end) {
  requestFocus();
  super.select(start, end);
}

代码示例来源:origin: com.hermit-reasoner/org.semanticweb.hermit

public void showNodeLabels(Node node) {
  if (node==null)
    m_nodeInfoTextArea.setText("");
  else {
    CharArrayWriter buffer=new CharArrayWriter();
    PrintWriter writer=new PrintWriter(buffer);
    Printing.printNodeData(m_debugger,node,writer);
    writer.flush();
    m_nodeInfoTextArea.setText(buffer.toString());
    m_nodeInfoTextArea.select(0,0);
  }
}

代码示例来源:origin: com.github.houbie/rhino-mod

@Override
public void select(int start, int end) {
  requestFocus();
  super.select(start, end);
}

代码示例来源:origin: net.java.openjdk.cacio/cacio-shared

@Override
public void select(int selStart, int selEnd) {
  getTextArea().select(selStart, selEnd);
}

代码示例来源:origin: org.jvnet.hudson/embedded-rhino-debugger

@Override
public void select(int start, int end) {
  requestFocus();
  super.select(start, end);
}

代码示例来源:origin: MegaMek/megamek

/**
 * Tries to scroll down to the end of the box
 */
public void moveToEnd() {
  if (chatArea.isShowing()) {
    int last = chatArea.getText().length() - 1;
    chatArea.select(last, last);
    chatArea.setCaretPosition(last);
  }
}

代码示例来源:origin: net.sourceforge.owlapi/org.semanticweb.hermit

/**
 * @param node node
 */
public void showNodeLabels(Node node) {
  if (node==null)
    m_nodeInfoTextArea.setText("");
  else {
    CharArrayWriter buffer=new CharArrayWriter();
    PrintWriter writer=new PrintWriter(buffer);
    Printing.printNodeData(m_debugger,node,writer);
    writer.flush();
    m_nodeInfoTextArea.setText(buffer.toString());
    m_nodeInfoTextArea.select(0,0);
  }
}

代码示例来源:origin: ZsBT/mrz-java

public void actionPerformed(ActionEvent e) {
    final String m = mrz.getText();
    try {
      final MrzRecord record = MrzParser.parse(m);
      JOptionPane.showMessageDialog(frame, "Parse successfull: " + record);
    } catch (Exception ex) {
      JOptionPane.showMessageDialog(frame, "Parse failed: " + ex);
      if (ex instanceof MrzParseException) {
        final MrzParseException mpe = (MrzParseException) ex;
        final MrzRange r = mpe.range;
        mrz.select(toPos(r.column, r.row, m), toPos(r.columnTo, r.row, m));
      }
    }
  }
});

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

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: org.codehaus.groovy/groovy-all-minimal

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: org.netbeans.modules/org-netbeans-modules-cnd-debugger-common2

private void selectCurrentLine(int x, int y) {
  // This is just temporary placeholder code
  int ln = ta.getLineCount(); 
  if (ln > 0) {
    try {
      selected_area_start = ta.getLineStartOffset(ln);
      selected_area_end = ta.getLineEndOffset(ln);
      ta.select(selected_area_start, selected_area_end);
    } catch (javax.swing.text.BadLocationException e) {
      //selected_area_start = 0;
      //selected_area_end = 0;
    }
  }
}

相关文章

JTextArea类方法