简体   繁体   中英

create vertical JDesktopPane at the left side of Jframe

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM