Yes, you can have both versions installed. I'm afraid I cannot tell how te set the version windows uses when you click a .jar file or open a java applet. But in most (probably all) IDEs you can simply set the direction of the javac.exe compiler. (By default its located in C:\program files\java\jdk1.4.2_09 or something).
If you are starting java/javac from the command line you have to set the right path to the bin directory under your java install location. This can be done in Configuration panel -> System -> Advanced -> Environment variables.