Quyen's answer may be the easiest.
Alternatively, in Chrome, once you've opened up SimplePaint.java from Moodle, you can right click anywhere on the web page and choose "Save as...", but then you'll need to change the file type from from ".txt" to "all files", and you'll need to rename it as "SimplePaint.java".
Then you can drag-and-drop the file into Eclipse. (I presume you can drag-and-drop it into IntelliJ too!)