Question: I am using Intellij idea IDE. Whenever I try to copy and paste any code from my browser to the IDE, it is not being pasted. Actually the last selection in the IDE is pasted every time. However if I paste it in any other application like notepad, it works fine.

What do I need to do?

Answer: 
I solved this problem by restarting intellij with the `invalidate cache\restart" menu option. Prior to restarting anything I'd had copied to the clipboard outside the IDE I couldn't paste, but afterward I could paste. I didn't investigate if just restarting would have worked. The menu option provides a nice way of closing all intellij windows at once on Windows.
Happens to me quite often on win 7. Seems to be after idea is running for longer period of time / through suspend. Standard close and relaunch of all idea windows works. Is the same in versions 14 and 15 (no tested other).