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); } }
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.
Created attachment 9135 [details] proposed patch
Patch proposed, should be patched in classpath very shortly.
Fixed.