Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); //得到系统剪贴板
String text = jTextField.getText(); //获取文本框的内容
StringSelection selection = new StringSelection(text);
clipboard.setContents(selection, null);
时间: 2024-11-01 09:30:23