-
Bug
-
Resolution: Fixed
-
P3
-
1.1.6, 1.2.0
-
1.2.2
-
generic, x86, sparc
-
generic, solaris_2.6, windows_95, windows_nt
Name: clC74495 Date: 09/28/98
JDesktopPane simply _does not work_ in Swing 1.1 beta 3. This problem
exists for all Look and Feels, including our own custom one. JInternalFrames
added to the desktop pane using .add() never show up.
This problem does not exist in Swing 1.0.2.
Simply by commenting out the javax.swing line and uncommenting the
com.sun.java.swing one (and changing the classpath), the following
example works in Swing 1.0.2/1.0.3. It fails very obviously in Swing 1.1
(the JInternalFrame never shows up).
This problem also has the very odd side effect of causing Look and Feel
initialization done around the same time as the .add() to fail.
We've traced though JLayeredPane.addImpl() and the JInternalFrame is
being added (and is in a correct layer, and is the only component in the
JDesktopPane), so we're stumped as to what is going wrong. The only
workaround we've found is removing the JDesktopPane and adding the
JInternalFrame directly to a panel, which is awful.
It would be _very, very_ bad if something this widely used and so
basic was broken in the public release of 1.1b3.
package jfilechooser;
import java.awt.*;
//import com.sun.java.swing.*;
import javax.swing.*;
public class MyClass1 extends JFrame {
public MyClass1() {
JDesktopPane jdp = new JDesktopPane();
this.getContentPane().add(jdp, BorderLayout.CENTER);
JInternalFrame jif = new JInternalFrame("A Frame");
jdp.add(jif, JDesktopPane.DEFAULT_LAYER);
try
{
jif.setMaximum(true);
}
catch (java.beans.PropertyVetoException pve)
{}
jif.setVisible(true);
}
public static void main(String[] args) {
MyClass1 myClass1 = new MyClass1();
myClass1.setSize(640,480);
myClass1.setVisible(true);
}
}
(Review ID: 39415)
======================================================================
- duplicates
-
JDK-4189622 Maximized JInternalFrames can't be size-restored after resizing parent Frame.
-
- Closed
-
-
JDK-4172978 Bad layout of JDesktopPane with maximized JInternalFrame
-
- Closed
-
-
JDK-4175490 maximize internalFrame at right-top JSplitePanel refresh wrong when resize Split
-
- Closed
-
-
JDK-4178448 JInternalFrame setMaximum(true) does not show up.
-
- Closed
-
-
JDK-4193155 maximized internal frames in JFrame containing a menu
-
- Closed
-