Joining objects

How would I join several objects so they would all keep their separate colors. If I simply select and Ctrl+J them the colors go all wonky.

i juist tryed it with 2 cubes with different mat and i worked fine.
do you have a blend file we can look at

Here ye go.

-removed link-

Aha! The colors looked way different in object mode, but when I rendered it they were normal. Then I removed all double vertices, recalculated normals and then the colors were correct in object mode too.