问题描述
我已经和Swing合作了一段时间,但是JFrame
s,paint()
,super
等的整个模型/结构在我脑海中都是模糊的.我需要一个清晰的解释或链接来解释整个GUI系统的组织方式.
I've been working with Swing for a while now but the whole model/structure of JFrame
s, paint()
, super
, etc is all murky in my mind.I need a clear explanation or link that will explain how the whole GUI system is organized.
推荐答案
我也遇到了同样的情况.实际上,到目前为止,我还不太了解它是如何工作的100%.
The same happened to me. Actually to this day I don't quite get 100% how all it works.
Swing是一个非常灵活的框架-也许太灵活了.灵活性带来了很多抽象,而抽象带来了混乱. :)
Swing is a very flexible framework - perhaps too flexible. With flexibility comes a lot of abstraction and with abstraction comes confusion. :)
我发现以下文章值得一读.他们帮助我更好地了解了Swing的概况.
I've found the following articles worth reading. They helped me to better understand the big picture of Swing.
- Swing体系结构概述
-
安装UI委托的过程,就是下面的图像:
- A Swing Architecture Overview
The process of installing a UI delegate, which is just this image:
他们很好地解释了模型和委托人的工作方式.当我看到那些JLabel
,LabelUI
,ui.update
等时,总是让我发疯.
They explain quite well how the model and the delegate work. It always drives me mad when I see those JLabel
, LabelUI
, ui.update
, etc.
这篇关于Java GUI Swing模型说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!