The java.awt.Toolkit class has getScreenResolution() and getScreenSize() methods. getScreenResolution() returns pixels-per-inch as an int, and getScreenSize() returns size of screen in pixels as a Dimension.
Recommended practice is not to use fixed sizes.
It's much better to make use of layout managers, preferred sizes, and the pack() method. As you've found, fixed sizes have no guarantee of being portable between resolutions... or releases. Sun changed some sizing calculations between 1.3 and 1.4... and we had components disappear where developers had used null layout and fixed sizes. The component didn't think it could fit into the fixed size, so it didn't draw!