jMenuItem de Colar e Selecionar

Java

08/05/2016

estou precisando dos códigos de de Colar e Selecionar texto para o meu editor de texto (na barra de opções), só que eu não acho em lugar nenhum na internet, se alguém puder me ajudar eu agradeceria muito.
Obrigado pela atenção.

Código:

private void jMenuSelecionarActionPerformed(java.awt.event.ActionEvent evt) {

}

private void jMenuColarActionPerformed(java.awt.event.ActionEvent evt) {

}
David Rodrigues

David Rodrigues

Curtidas 0

Respostas

David Rodrigues

David Rodrigues

08/05/2016

private void jMenuCopiarActionPerformed(java.awt.event.ActionEvent evt) {

Clipboard board = Toolkit.getDefaultToolkit().getSystemClipboard();
ClipboardOwner selection = new StringSelection(jepTexto.getText());
board.setContents((Transferable)selection, selection);


}
GOSTEI 0
POSTAR