开发者

JInternalFrame snaps back to original position when cursor leaves container

开发者 https://www.devze.com 2023-03-29 15:43 出处:网络
I have a JInternalFrame inside a JPanel, all is working great, but when I reposition the internal frame and then move the cursor outside the JPanel, it resets its position.

I have a JInternalFrame inside a JPanel, all is working great, but when I reposition the internal frame and then move the cursor outside the JPanel, it resets its position.

I couldn't see anyt开发者_JAVA百科hing in the API related to this.


I have a JInternalFrame inside a JPanel,

An internal frame was not designed to be used with a JPanel.

It was designed to be used with a JDesktopPane which uses a null layout. A JPanel uses a FlowLayout by default.

So I would guess somehow the layout manager is invoked and the location of the internal frame is being reset.

Just use a desktop pane and you won't have these problems.

0

精彩评论

暂无评论...
验证码 换一张
取 消