Java GUI Swing Model Explanation

前端 未结 7 1233
醉酒成梦
醉酒成梦 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:32

    Since this question is tagged with JFrame, I'll suggest a few links for understanding how JFrames and other top-level Swing containers work.

    I also found that Swing was (and still is) quite involved and taking a look at the documentation provided by Sun is required every once in a while -- Every time I check, I seem to learn something new.

    First, the basics: JFrame class from the Java API Specifications. The Java API Specifications often provide good detailed information about the classes. In this instance, you'll notice that there are several links such as How to Make Frames section from The Java Tutorials.

    Aside from that, I'll also recommend looking at the Lesson: Using Swing Components from The Java Tutorials. The lesson provides instructions on how to use the components provided in Swing along with some useful examples.

    For more specifics parts that I've found confusing when I started with Swing was all the different types of panes, such as the ContentPane, RootPane, GlassPane. The Using Top-Level Containers section provides information and helpful diagrams on the container hierarchy of the top-level containers. The How to Use Root Panes section gets into the details about the Glass, Layered, and Content Panes with plenty of examples.

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