Unfortunately, that method only works if you have a full screen app, and there's no equivalent for changing the "native" (non-full screen) resolution in pure Java*. Furthermore, there's only a limited number of resolutions you can change the monitor to. If someone's monitor is big enough, you can use a larger monitor to ensure that your window fits, but if the maximum resolution on their monitor is smaller, there's nothing you can do about it (ex. some monitors have a maximum resolution of 1024*768, therefore it's impossible for you to adjust the resolution above that even with native code).
*note: when I say only works in full screen mode, I mean only works safely in full screen mode. The JVM implementation must support it for each specific OS, which unfortunately is not the case. I know the Sun JVM for Windows will only let change the resolution of full screen applications, otherwise you'll get an UnsupportedOperationException. I can't remember where I read/heard this, but I think the only OS's which do support this operation for non-full screen mode are Linux and Solaris (don't take my word for this, though).