Absolute positioning (No layout manager) vs. absolute positioning in MiGlayout

萝らか妹 提交于 2019-12-07 20:06:44

问题


Will the final application result be identical across different platforms and resolutions etc. when using absolute positioning in MiGlayout as the layout manager compared to using no layout manager (Setting layout manager to null)?

Is there a difference between the absolute positioning in MiGlayout solution vs. the no layout manager solution?


回答1:


Think about this. Even if you supply a singe font for your application, it will be rendered differently on different OSs, it can even be rendered differently on the same OS under different DPI.

Layout managers are your protection against these problems, sure, when you first start using them, they seem to get in the way, but once you get use to them, you'll never want to do without (try coding in VB and tell me otherwise)

Layout managers let you focus on the complexities of flow control and usability, without having to worry how it might appear at a font 2pts larger then you are designing with, or on larger/smaller screen resolutions.

I've spent 2 years undoing the previous developers work who insisted on using Arial font and manually setting of component sizes because he believed he couldn't get his forms to layout properly. The feed back I have from users about the change has all been positive and we're now looking to implementing dynamic font resizing into the application. There is no way I'd try that without layout managers.

I'd say you have a better chance with MigLayout then you do without -IMHO




回答2:


Is there a difference between the absolute positioning in MiGlayout solution vs. the no layout manager solution?

yes and most important, JComponents layed by AbsoluteLayout aren't resizible with Container, have to add ComponentListener and to create bunch of code for continious resize, this is hardier job as learning how MigLayout works



来源:https://stackoverflow.com/questions/12213247/absolute-positioning-no-layout-manager-vs-absolute-positioning-in-miglayout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!