你最好的Swing设计模式和提示是什么?

编程入门 行业动态 更新时间:2024-10-09 09:11:23
本文介绍了你最好的Swing设计模式和提示是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在使用Swing编写一个应用程序的GUI,为了代码维护和可读性,我想在整个系统中遵循一致的模式。

<我读过的大多数文章和书籍(或至少书本部分)似乎提供了大量关于如何创建和排列各种组件的示例,但忽略了编写完整GUI的更大的图景。

应用程序GUI设计的最佳提示是什么?您在设计或重构GUI应用程序时遵循哪些模式?

解决方案

使用布局管理器。你可能会认为现在只要将所有东西都放在硬编码位置上(特别是如果你使用图形布局工具)更简单,但是当它更新gui或者将其国际化的时候,你的继承者会讨厌你。 (相信我这个,我是从一开始就使用布局管理员的人,也是忽略我的那个人的继任者。)

I'm writing a GUI for an application using Swing, and in the interests of code maintenance and readability, I want to follow a consistent pattern throughout the whole system.

Most of the articles and books (or at least book sections) that I've read appear to provide plenty of examples on how to create and arrange various components, but ignore the bigger picture of writing a full GUI.

What are your best tips for application GUI design, and what patterns do you follow when designing or refactoring a GUI application?

解决方案

Use layout managers. You might think it's simpler just to position everything with hard coded positions now (especially if you use a graphical layout tool), but when it comes time to update the gui, or internationalize it, your successors will hate you. (Trust me on this, I was the guy saying to use the layout managers from the start, and the successor to the guy who ignored me.)

更多推荐

你最好的Swing设计模式和提示是什么?

本文发布于:2023-11-27 09:49:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637579.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:最好的   提示   模式   Swing

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!