Request for feedback: implementing Swing-based drawers
I've inherited some code to which I need to add a 'dresser drawer' like functionality. Click on a logical 'open' button and the drawer opens, revealing, or displaying as the case may be, a JPanel with more stuff in it. Click on a logical 'close' button and the drawer closes, leaving its container in the visual state in which it started. A familiar example of this effect might be something like the Mac Dock in 'auto hide' mode, where the Dock moves in and out of sight and addressability with some pointer action. The Dock is always 'there', but sometimes just not visible. So it would be with the drawer.
I am wondering if a solution would be based loosely on theDrawer.setVisible(), or whether something that sets the drawer's component width or height to 0 for-hide would be more likely.
Can anyone offer guidance on how to approach this using standard Swing techniques?