private void updateSystemSelection() { if (GraphicsEnvironment.isHeadless()) return; final Clipboard clip = myEditor.getComponent().getToolkit().getSystemSelection(); if (clip != null) { clip.setContents(new StringSelection(myEditor.getSelectionModel().getSelectedText(true)), EmptyClipboardOwner.INSTANCE); } }
private void updateSystemSelection() { if (GraphicsEnvironment.isHeadless()) return; final Clipboard clip = myEditor.getComponent().getToolkit().getSystemSelection(); if (clip != null) { clip.setContents(new StringSelection(getSelectedText()), EmptyClipboardOwner.INSTANCE); } }