When you click on the button, you must copy the text from TextField to the clipboard. There is an option on Swing that fits perfectly, but on JavaFX.
public static void setClipboard(String str) { StringSelection ss = new StringSelection(str); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null); }