I have two textPane on a JFrame and want to add a popup menu(copy/past) for each of them. How can I get around of creating two JPopupMenus? just use one for both?
Thank you!
Chinese Java Faq Forum
Thank you!
Chinese Java Faq Forum
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
jMenuItemCopy.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
Clipboard clipboard = getToolkit ().getSystemClipboard ();
StringSelection selection = new StringSelection(jTextPaneResultConsole.getSelectedText());
clipboard.setContents(selection,selection );
}
});