I wonder if there is good documentation (or a (viewable) book) on the
life cycle of Swing components .
Is the "life cycle" the right term?
I hope to find answers to the question, for example:
- How, when, in what order are the drawing methods called ?
- How, when, what events are triggered by whom?
- What is the sequence method calls to create components?
From time to time I come across unusual behavior of my applications, for example:
- The ComponentListener resize event is fired before setVisible (true)
(so the root panel has negative dimensions!) - Some components are correctly decomposed only after manually resizing the JFrame
- Changing a superclass from JPanel to JLayeredPane calls my class, which should be laid out differently inside another container.
- And many other strange things ...
source
share