Java GUI Swing Model Explanation

前端 未结 7 1232
醉酒成梦
醉酒成梦 2021-02-01 23:31

I\'ve been working with Swing for a while now but the whole model/structure of JFrames, paint(), super, etc is all murky in my mind. I nee

相关标签:
7条回答
  • 2021-02-02 00:09

    If, after reading the Swing tutorial, you find your interest lies in more advanced topics, you may also wish to look at Swing Second Edition by Robinson and Vorobiev.

    0 讨论(0)
  • 2021-02-02 00:10

    Filthy Rich Clients by Chet Haase and Romain Guy is a great book about Java UI. It covers some more advanced stuff too, but introduction and few first chapters explain fundamental things well.

    0 讨论(0)
  • 2021-02-02 00:15

    Have you looked at the Java Swing Tutorial (click here)? It does a pretty good job of covering the basics of developing Swing applications.

    0 讨论(0)
  • 2021-02-02 00:22

    I found Swing Explorer to be a precious tool to understand the hierarchy of components (particularly in complex GUIs) and look at properties (alas, read-only: we get used to Firebug convenience!). It has an Eclipse plugin.

    0 讨论(0)
  • 2021-02-02 00:26

    I've found that simply browsing around in the source code (ctrl-click on a name if you're using NetBeans) has been really helpful. If I see a method appear in the completion dialog that I'm not familiar with, I'll just click "Go to source" and look around until I'm comfortable with it.

    0 讨论(0)
  • 2021-02-02 00:32

    The same happened to me. Actually to this day I don't quite get 100% how all it works.

    Swing is a very flexible framework - perhaps too flexible. With flexibility comes a lot of abstraction and with abstraction comes confusion. :)

    I've found the following articles worth reading. They helped me to better understand the big picture of Swing.

    • A Swing Architecture Overview
    • The process of installing a UI delegate, which is just this image:

    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.

    0 讨论(0)
提交回复
热议问题