2

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 anything in the API related to this.

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
Sam
  • 3,659
  • 3
  • 36
  • 49
  • 2
    Seems your internal frame is no longer scared by the mousepointer, hence he jumps back to his favourite position ^-^ (Sorry, could not help myself laughing ;D your problem seems very strange, never saw/heard something like this) – Angel O'Sphere Aug 22 '11 at 13:42
  • 1
    Please post an SSCCE, this is not normal, there must be something else going on here. – jzd Aug 22 '11 at 14:13

1 Answers1

3

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.

camickr
  • 321,443
  • 19
  • 166
  • 288