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

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

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

JTextArea.getText介绍

暂无

代码示例

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

/**
 * retrieves the string representation of the source code
 *
 * @return source code's string representation
 */
public String getSourceCode() {
  return sourceCodeArea.getText();
}

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

public String getXPathExpression() {
  return xPathArea.getText();
}

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

/**
 * When the fontsize of a JTextArea is changed, the word-wrapped lines
 * may become garbled.  This method clears and resets the text of the
 * text area.
 */
protected void refresh(JTextArea textArea) {
 String text = textArea.getText();
 textArea.setText("");
 textArea.setText(text);
}

代码示例来源:origin: stanfordnlp/CoreNLP

@SuppressWarnings("UnusedDeclaration")
private void performTagAction(ActionEvent e) {
 final String s = inputBox.getText();
 Thread t = new Thread() {
  @Override
  public void run() {
   final String taggedStr = tagger.tagString(s);
   SwingUtilities.invokeLater(() -> outputBox.setText(taggedStr));
  }
 };
 t.start();
}

代码示例来源:origin: igniterealtime/Smack

@Override
  public void actionPerformed(ActionEvent e) {
    // Get the clipboard
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    // Set the sent text as the new content of the clipboard
    clipboard.setContents(new StringSelection(receivedText1.getText()), null);
  }
});

代码示例来源:origin: igniterealtime/Smack

@Override
  public void actionPerformed(ActionEvent e) {
    // Get the clipboard
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    // Set the sent text as the new content of the clipboard
    clipboard.setContents(new StringSelection(sentText1.getText()), null);
  }
});

代码示例来源:origin: igniterealtime/Smack

@Override
  public void actionPerformed(ActionEvent e) {
    // Get the clipboard
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    // Set the sent text as the new content of the clipboard
    clipboard.setContents(new StringSelection(interpretedText1.getText()), null);
  }
});

代码示例来源:origin: igniterealtime/Smack

@Override
  public void actionPerformed(ActionEvent e) {
    // Get the clipboard
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    // Set the sent text as the new content of the clipboard
    clipboard.setContents(new StringSelection(sentText.getText()), null);
  }
});

代码示例来源:origin: igniterealtime/Smack

@Override
  public void actionPerformed(ActionEvent e) {
    // Get the clipboard
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    // Set the sent text as the new content of the clipboard
    clipboard.setContents(new StringSelection(messageTextArea.getText()), null);
  }
});

代码示例来源:origin: igniterealtime/Smack

@Override
  public void actionPerformed(ActionEvent e) {
    // Get the clipboard
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    // Set the sent text as the new content of the clipboard
    clipboard.setContents(new StringSelection(receivedText.getText()), null);
  }
});

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

private String showInputDialog(String title, String defaultText){
  JTextArea msg = new JTextArea(defaultText);
  msg.setLineWrap(true);
  msg.setWrapStyleWord(true);
  JScrollPane scrollPane = new JScrollPane(msg);
  scrollPane.setPreferredSize(new Dimension(600, 250));
  scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
  int ris = JOptionPane.showConfirmDialog(null, scrollPane, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
  if(ris == JOptionPane.OK_OPTION)
    return msg.getText();
  else
    return defaultText;
}

代码示例来源:origin: iluwatar/java-design-patterns

Order order = new Order(jtFields[0].getText(), jtFields[1].getText(), jtAreas[0].getText(), jtFields[2].getText(),
   jtAreas[1].getText());
 jl.setText(sendRequest(order));
});

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

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

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

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

代码示例来源:origin: igniterealtime/Smack

@Override
  public void actionPerformed(ActionEvent e) {
    if (!"".equals(adhocMessages.getText())) {
      AdHocPacket packetToSend = new AdHocPacket(adhocMessages.getText());
      try {
        connection.sendStanza(packetToSend);
      }
      catch (InterruptedException | NotConnectedException e1) {
        LOGGER.log(Level.WARNING, "exception", e);
      }
    }
  }
});

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

@Override
  public void actionPerformed(ActionEvent e) {
    UIUtil.clipboardCopy(jta_out.getText());
  }
});

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

private void add() {
  String str = jta_in.getText();
  if ("".equals(str.trim())) {
    JOptionPane.showMessageDialog(me, "Please enter input text!", "No Input", JOptionPane.ERROR_MESSAGE);
    return;
  }
  
  MultiEntryRes res = MultiEntryUtil.parse(str);
  me.setVisible(false);
  callback.add(res);
}

代码示例来源:origin: ballerina-platform/ballerina-lang

@Override
public boolean isModified() {
  final String text = repositoriesTextArea.getText();
  return !placeholder.equals(text) && !text.equals(getStateString()) && CoursierImpl$.MODULE$.checkRepositories(text, false);
}

代码示例来源:origin: ballerina-platform/ballerina-lang

@Override
public void apply() {
  final String text = repositoriesTextArea.getText();
  if (text.trim().isEmpty() || text.equals(placeholder)) {
    state.setCoursierResolvers(Collections.emptyList());
  } else if (CoursierImpl$.MODULE$.checkRepositories(text, true)) {
    state.setCoursierResolvers(Utils.stringToList(text, Utils.lineSeparator()));
  }
}

代码示例来源:origin: 4thline/cling

@Override
  protected Message createMessage() {
    return new MessageSMS(
        getDisplayMaximumCheckBox().isSelected() ? Message.DisplayType.MAXIMUM : Message.DisplayType.MINIMUM,
        dateTimeField.getDateTime(),
        receiverNumberNameField.getNumberName(),
        senderNumberNameField.getNumberName(),
        bodyTextArea.getText()
    );
  }
}

相关文章

JTextArea类方法