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

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

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

JTextArea.insert介绍

暂无

代码示例

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

pad = ta.getSelectedText();
else if (choice == pasteI)
  ta.insert(pad, ta.getCaretPosition());
else if (choice == selectI)
  ta.selectAll();

代码示例来源:origin: us.ihmc/IHMCJavaToolkit

public void appendMessage(String message)
{
 if (quiet)
   return;
 //    textArea.append(message + "\n");
 if (message.length() > (WIDTH - 1 + 25))
   message = message + "\n";
 textArea.insert(message + "\n", 0);
}

代码示例来源:origin: us.ihmc/ihmc-java-toolkit

public void appendMessage(String message)
{
 if (quiet)
   return;
 //    textArea.append(message + "\n");
 if (message.length() > (WIDTH - 1 + 25))
   message = message + "\n";
 textArea.insert(message + "\n", 0);
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

public void appendMessage(String message)
  {
   if (QUIET)
     return;

//    textArea.append(message + "\n");

   if (message.length() > (WIDTH - 1 + 25))
     message = message + "\n";

   textArea.insert(message + "\n", 0);
  }

代码示例来源:origin: org.dspace/dspace-sword-api

/**
* Add a single character to the text area. 
* 
* @param character The character. 
*/
public void addCharacter(Character character)
{
 messages.insert(character.toString(), messages.getDocument().getLength());
}

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

/**
 * Add a message to the text area. The message will be added with a carriage return.
 *
 * @param message The message.
 */
public void addMessage(String message) {
  messages.insert(message + "\n", messages.getDocument().getLength());
}

代码示例来源:origin: us.ihmc/ihmc-java-toolkit

public void appendMessage(String message, Color color)
{
 if (quiet)
   return;
 //    textArea.setForeground(color);
 //    textArea.setSelectedTextColor(color);
 textArea.setSelectionColor(color);
 //    textArea.append(message + "\n");
 if (message.length() > (WIDTH - 1 + 25))
   message = message + "\n";
 textArea.insert(message + "\n", 0);
}

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

/**
 * Add a single character to the text area.
 *
 * @param character The character.
 */
public void addCharacter(Character character) {
  messages.insert(character.toString(), messages.getDocument().getLength());
}

代码示例来源:origin: apache/axis2-java

private void setModule(String module){
    int position = desArea.getCaretPosition();
    String str = "      <module ref=\"" + module + "\" />\n";
    desArea .insert(str, position + 1);
  }
}

代码示例来源:origin: org.dspace/dspace-sword-api

/**
* Add a message to the text area. The message will be added with a carriage return. 
*  
* @param message The message. 
*/
public void addMessage(String message)
{
 messages.insert(message + "\n", messages.getDocument().getLength());
}

代码示例来源:origin: org.swordapp/sword-common

/**
* Add a message to the text area. The message will be added with a carriage return. 
*  
* @param message The message. 
*/
public void addMessage(String message)
{
 messages.insert(message + "\n", messages.getDocument().getLength());
}

代码示例来源:origin: org.swordapp/sword-common

/**
* Add a single character to the text area. 
* 
* @param character The character. 
*/
public void addCharacter(Character character)
{
 messages.insert(character.toString(), messages.getDocument().getLength());
}

代码示例来源:origin: com.darwinsys/darwinsys-api

public void actionPerformed(ActionEvent e) {
    ta.insert(new Date().toString(), ta.getCaretPosition());
  }
});

代码示例来源:origin: us.ihmc/IHMCJavaToolkit

public void appendMessage(String message, Color color)
{
 if (quiet)
   return;
 //    textArea.setForeground(color);
 //    textArea.setSelectedTextColor(color);
 textArea.setSelectionColor(color);
 //    textArea.append(message + "\n");
 if (message.length() > (WIDTH - 1 + 25))
   message = message + "\n";
 textArea.insert(message + "\n", 0);
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

public void appendMessage(String message, Color color)
  {
   if (QUIET)
     return;

//    textArea.setForeground(color);
//    textArea.setSelectedTextColor(color);
   textArea.setSelectionColor(color);

//    textArea.append(message + "\n");

   if (message.length() > (WIDTH - 1 + 25))
     message = message + "\n";

   textArea.insert(message + "\n", 0);
  }

代码示例来源:origin: IanDarwin/darwinsys-api

public void actionPerformed(ActionEvent e) {
    ta.insert(new Date().toString(), ta.getCaretPosition());
  }
});

代码示例来源:origin: antlr/intellij-plugin-v4

public void displayErrorInParseErrorConsole(SyntaxError e) {
  String msg = getErrorDisplayString(e);
  errorConsole.insert(msg+'\n', errorConsole.getText().length());
}

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

@Override
public void insert(String text, int pos) {
  getTextArea().insert(text, pos);
}

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

public void listen() {
    String s;
    while ((s = in.readLine()) != null) {
      enteredText.insert(s + "\n", enteredText.getText().length());
      enteredText.setCaretPosition(enteredText.getText().length());
    }
    out.close();
    in.close();
    try                 { socket.close();      }
    catch (Exception e) { e.printStackTrace(); }
    System.err.println("Closed client socket");
  }
}

代码示例来源:origin: apache/axis2-java

private void setParameter(ParameterObj obj){
  int position = desArea.getCaretPosition();
  System.out.println(desArea.getLineCount());
  System.out.println(desArea.getCaretPosition());
  String str = "      <parameter name=\"" + obj.getName() + "\" locked=\"false\">"
            + obj.getValue() +
            "</parameter>\n";
  desArea.insert(str, position + 1);
}
private void setModule(String module){

相关文章

JTextArea类方法