简体   繁体   English

在Jframe的左侧创建垂直的JDesktopPane

[英]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. 我想创建一个垂直的JDesktopPane,这样当JInternalFrame最小化它的图标时,它会添加到Jframe的左侧,并且垂直地位于其他图标的下方,而不是以前的图标的旁边和水平。 it may be the same as linux or mac desktopPane that their desktopPane is at the left side of screen not at the bottom. 它们的desktopPane位于屏幕的左侧而不是底部,可能与linux或mac desktopPane相同。

You should probably create a custom DesktopManager . 您可能应该创建一个自定义DesktopManager The DesktopManager is responsible for managing the desktop. DesktopManager负责管理桌面。 In particular you would want to extend the DefaultDesktopManager as it provides the current support for positioning the buttons of the minimized internal frames. 特别是,您将希望扩展DefaultDesktopManager,因为它为定位最小化内部框架的按钮提供了当前支持。

In particular I would think you need to override the getBoundsForIconOf(...) method and probably the getPreviousBounds(...) . 特别是,我认为您需要重写getBoundsForIconOf(...)方法,并且可能重写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. 这篇文章有一个入门的小例子://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. 自定义代码只会将内部框架最大化到图标化按钮的顶部。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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