问题
I've got a class extending JDesktopPane in which I have a JInternalFrame, which I can Iconify, I really like this, but when I iconify it, it goes to the left, bottom side of my screen. I'd like to change this to the right, top side of the screen. Does anyone have any suggestions on how to set that location?
回答1:
You're using the DefaultDesktopManager to manage your JDesktopPane.
The DefaultDesktopManager class implements the DesktopManager interface.
Looking at the source code for DefaultDesktopManager, the getBoundsForIconOf method is protected. You might be able to extend DefaultDesktopManager to get the icon behavior that you want. Otherwise, you'll have to write your own implementation of the DesktopManager interface.
来源:https://stackoverflow.com/questions/14754724/how-to-set-the-standard-iconified-location-for-a-jinternalframe