A few months ago, I read this Swing tutorial http://zetcode.com/tutorials/javaswingtutorial/resizablecomponent/ to understand how to implement mutable components inside Swing.
The tutorial talks about using an empty LayoutManager to be able to absolutely position child components.
In a discussion on another subject, @ Andrew Thompson noted that using a null layout is a bad idea. In this article http://download.oracle.com/javase/tutorial/uiswing/layout/none.html to describe the zero-layout manager as undesirable too, in any case, he says that in certain situations it can be useful.
In a situation where:
- I need absolute positioning for child JPanel components.
- I need to implement my own constraint framework conditions for child components (to establish possible overlap situations)
- I need the JPanel child component to change.
Is the zero layout manager used correctly in this situation?
Or are there other better solutions to achieve these goals using the layout manager for my JPanel component container?
early
source share