I'm creating a custom Swing component that inherits from JPanel.
What is the right way to override/implement the various sizing methods (getPreferredSize, setPreferredSize, getMinimumSize etc.) in order to get "good behaviour", particularly with regards to:
- Working with different layout managers
- Behaving correctly when setPreferredSize() is called
- Reacting appropriately when a border is set via setBorder()