Bug 22151 - JInternalFrame causes OutOfMemory error when maximized.
Summary: JInternalFrame causes OutOfMemory error when maximized.
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: swing (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: 0.18
Assignee: Anthony Balkissoon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-22 19:06 UTC by Anthony Balkissoon
Modified: 2005-10-16 01:47 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
proposed patch (446 bytes, patch)
2005-06-23 18:20 UTC, Anthony Balkissoon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Balkissoon 2005-06-22 19:06:52 UTC
JInternalFrame causes OutOfMemory error when maximized.

Run the test case below, maximize the JInternalFrame, wait a while.  OutOfMemory
error.  

When the JInternalFrame is positioned at (10,10) rather than (60,60) the error
doesn't occur.

==TEST CASE==
import java.awt.*;
import javax.swing.*;
import java.io.*;

public class OutOfMemory {
   public static void main(String[] a) throws IOException{
      JFrame myFrame = new JFrame("Outer");
      myFrame.setSize(300,300);
      myFrame.setContentPane(new JDesktopPane());
      JInternalFrame f = new JInternalFrame("Internal");
      f.setSize(200,200);
      f.setVisible(true);
      f.setClosable(true);
      f.setMaximizable(true);
      f.setResizable(true);
      f.setIconifiable(true);
      /* IF THE FOLLOWING LINE IS CHANGED TO f.setLocation (10,10)
         no OutOfMemory error occurs! */
      f.setLocation(60,50);
      myFrame.add(f);
      myFrame.setVisible(true);
   }
}
Comment 1 Anthony Balkissoon 2005-06-23 17:20:25 UTC
1: removing the call to handleEvent() in
BasicInternalFrameUI$GlassPaneDispatcher.mouseExited fixes the problem, but does
it break something else?

2: after maximizing, you have to move the mouse to trigger the infinite loop.
Comment 2 Anthony Balkissoon 2005-06-23 18:20:57 UTC
Created attachment 9135 [details]
proposed patch
Comment 3 Anthony Balkissoon 2005-06-23 18:21:52 UTC
Patch proposed, should be patched in classpath very shortly.
Comment 4 Anthony Balkissoon 2005-09-01 18:27:30 UTC
Fixed.