The touch-screen application I am developing will be used on different screen resolutions. I never had to worry about this before, but now I do. I am wondering how can I design the GUIs so that EVERY object on the GUI resizes proportionally to fit the screen resolution? Can you refer me to a good tutorial page? I am designing the application using the NetBeans and the Swing framework. Thank you
1 Answers
I am wondering how can I design the GUIs so that EVERY object on the GUI resizes proportionally to fit the screen resolution?
- not easy job you have to test all possible pixels ratio that exist (by default is possible to change and set various pixels ratio on todays fullHD screen) with lot of fails 
- this is reason why LayoutManagers exist, 
- I'd suggest to use NestedLayout 
- sure there are custom - LayoutManagers, for example by using- MigLayout(something betweens- GridBagLayoutand- SpringLayout) is possible to put all JComponents to the container from one place, but again I'd be suggest use- NestedLayoutinstead
- you have to set (internally) minimum screenSize for displaying contents in the - JScrollPane, for example screen with resolutions less than 1024 x 600 will have the content scrollable, otherwise let's this job for- LayoutManagers,
- this idea required model - JFrame--->- JScrollPane--->- JPanel(father panel) in all cases,- JScrollPanewill protect your GUI against small (and dual too) screen resolutions
- you have to look at - FontMetricsfor- Font, because you need in/decrease- Fontsize for various pixel ratios continiously with- JComponentssize on the screen
- same with - Iconsif exist, prepare that before in some of Graphics SW's, not resize on runtime
- my view ---> any - Frameworkbased on- AWT/Swingisn't advantage for job this nature,
 
     
    