using java mouse robot to select, copy, and paste to JTextfield or similar
<p>so this is a pretty simple problem i guess, but i haven't really found a solution after scrounging around for a couple hours. </p>

<p>basically i want to get data from this website: <a href="http://www.truefx.com/" rel="nofollow">http://www.truefx.com/</a> into my java program. (it doesn't have to be pasted to a jtextfield, however) </p>

<p>the quotes on that webpage are silent now (not moving) but they are updated on a second by second basis when the mkt is open during the normal weekdays. i need my program to click and copy and paste the quotes a couple times each second, and then get that value into my program so i can bring my auto-trading algorithms to bear on it. </p>

<p>what i have so far is not much really, just a skeleton, i was messing around testing the robot and then i found the idea to use the clipboard (which i don't fully understand yet) but even if i do get the clipboard to work, i still don't know how to get the robot to copy what it has selected. right now i can target the text i want, and select it with a double click, but i don't know how to copy/paste it into my program.</p>

<p>here is my code right now, just to let you know where i'm at. thanks for the help, and sorry if the question format is screwy, first time posting here. </p>

<pre><code>import java.awt.*;
import java.awt.event.*;
import java.awt.datatransfer.*;
import java.io.IOException;

public class clickBot implements ClipboardOwner, Transferable{

    public void lostOwnership(Clipboard clipboard, Transferable contents) {
    System.out.println("overwritten");
    }
    public static void main(String[]args)throws Exception{

    //Clipboard clipboard = getToolkit().getSystemClipboard ();

    Robot bot = new Robot();
    bot.mouseMove(1100,650);

    bot.mousePress(InputEvent.BUTTON1_MASK);
    bot.mouseRelease(InputEvent.BUTTON1_MASK);
    bot.mousePress(InputEvent.BUTTON1_MASK);
    bot.mouseRelease(InputEvent.BUTTON1_MASK);
    bot.mousePress(InputEvent.BUTTON1_MASK);
    bot.mouseRelease(InputEvent.BUTTON1_MASK);


    Clipboard c = new Clipboard("board");
    }

    public Object getTransferData(DataFlavor flavor)
            throws UnsupportedFlavorException, IOException {

        return null;
    }
    public DataFlavor[] getTransferDataFlavors() {

        return null;
    }
    public boolean isDataFlavorSupported(DataFlavor flavor) {

        return false;
    }




}
</code></pre>
