I’m trying to make an application that – in some stage – stores all the statements copied by CTRL+C , and manipulating the ‘buffer’ carrying the current statement to a specific statement
example : user pressed CTRL + C to copy the “Hello” , if he presses CTRL + V at any text area/field the written word would be “Hello” , I want the written statement to be “Test” instead of “Hello”
the question is : how to access the buffer carrying the copied statement and manipulate its content using Java ?
I added polling for some simple testability/verification. It’ll check the clipboard once a second for a minute. As far as I’m aware, there’s no way to do event-based notification (unless you’re listening for flavor changes, which you’re not), so I think you’re stuck with polling.