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.
Swing in Java is a lightweight GUI toolkit which has a wide variety of widgets for building optimized window based applications. It is a part of the JFC( Java Foundation Classes). It is build on top of the AWT API and entirely written in java. It is platform independent unlike AWT and has lightweight components.
A JFrame is a Swing component which is the newer one, well today's java GUI development uses mostly Swing as an advantage you can have a lot of community support on it. as far as I know Swing has LookAndFeel Feature that you can configure to change the look of your GUI with just few line of codes.
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.
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.
Have you looked at the Java Swing Tutorial (click here)? It does a pretty good job of covering the basics of developing Swing applications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With