Reputation: 176
i want to create a vertical JDesktopPane thus when a JInternalFrame minimizes its icon adds at the left side of Jframe and vertically below other icons not next to the previous icons and horizontally. it may be the same as linux or mac desktopPane that their desktopPane is at the left side of screen not at the bottom.
Upvotes: 0
Views: 218
Reputation: 324137
You should probably create a custom DesktopManager
. The DesktopManager is responsible for managing the desktop. In particular you would want to extend the DefaultDesktopManager as it provides the current support for positioning the buttons of the minimized internal frames.
In particular I would think you need to override the getBoundsForIconOf(...)
method and probably the getPreviousBounds(...)
. You could look at the source code to see how it works for the horizontal layout and modify the code for your vertical layout.
This posting has a little example to get you started: //stackoverflow.com/questions/18433475/jdesktoppane-minimising-jinternalframes. Normally when you maximize an internal frame it will cover any iconified buttons. The custom code will only maximize the internal frame to the top of the iconified buttons.
Upvotes: 2