What do you mean exactly? They should work the same unless you're using some feature that only XP has, which is probably not possible with a pure Java program. Also, they may look slightly different because XP buttons, scroll bars, etc look different from Windows 2000 ones. But other than that, there's no reason why any program shouldn't work the same on both systems. You don't even have to compile them again or anything.
> They should work the same unless you're using some feature that only XP has,
> which is probably not possible with a pure Java program.
Really? You can always invoke native commands from a Java program, or depend on the exact layout of the OS (e.g. hardwiring the string "c:\\winnt" in your program, which would fail on WinXP, which is usually installed into "C:\\Windows").
There are so many hundreds of ways to accidentally get too OS-specific in any Java program. Also, there are subtle differences in the GUI libraries between different versions of Java, even on the same platform.