Fixed size swing GUI changes when using different resolution
I have a small java application with a swing gui. I have set a fixed size for the window and everything wor开发者_如何学JAVAks really well. But when using the GUI on different screens, the objects seem to have moved slightly. (Labels not showing their entire text etc,...) I think the difference lies in the aspect ratio of the screen but is there any way to counter this?
The way to counter it is to not used fixed size windows.
I agree with Bryan. There are many reasons - the screen resolution, localization (if you do so), different look-and-feels and rendering depending on the platform and/or JVM version. Swing's layouts are flexible enough to do everything you want without fixing the frame size. Otherwise you are going to implement your rendering engine to calculate everything which is rendered.
精彩评论