用户界面通常是如何构建的?
我有四个舱位的航班、乘客、座位表和候补名单。我正在尝试创建一个图形用户界面。我是摇摆新手,所以我不知道它是如何完成的。我应该为 gui 创建一个单独的类并在那里构建所有 gui,还是应该将我的 gui 代码合并到那些已经存在的类中?如果有一般准则,如何实施?
I have four classes flight, passenger, seating chart, and waiting list. I'm trying to create a gui. I am new to swing so I dont know how it is done. should I create a separate class for a gui and build all the gui there or should I incorporate my gui code in those already existing classes? how is it implemented if there is a general guideline?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您提到的类是模型类;它们用于抽象系统的数据。您永远不应该将演示 [GUI] 代码放在模型类中。您的演示文稿必须有单独的类/代码[GUI]。
一般准则是:
The classes that you mention are model classes; they are used to abstract the data of your system. You should never put your presentation [GUI] code in model classes. You must have separate classes/code for your presentation[GUI].
The general guideline is that :
在所有编程语言中,将 UI 和代码分开是很好的做法。更好地理解并保持代码干净。
In all programming languages is nice to separate UI and code. It's better to understand and keeps you code clean.