-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta2
-
sparc
-
solaris_2.6
Name: nkR10003 Date: 04/06/2001
JavaDoc comments for method MetalRootPaneUI.installUI state:
"Invokes supers implementation of installUI to install the necessary state
onto the passed in JRootPane to render the metal look and feel implementation
of RootPaneUI. This will also install a new LayoutManager on the JRootPane.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If the windowDecorationStyle property of the JRootPane is other than
JRootPane.NONE, this will add a custom Component to render the widgets to
JRootPane, as well as installing a custom Border on the JRootPane."
Actually installUI method does not install LayoutManager.
Example below demonstrates this problem:
------------------example--------------------
import javax.swing.JRootPane;
import javax.swing.plaf.metal.MetalRootPaneUI;
public class test {
public static void main(String[] args) {
JRootPane pane = new JRootPane();
pane.getUI().uninstallUI(pane);
pane.setLayout(null);
MetalRootPaneUI ui = new MetalRootPaneUI();
ui.installUI(pane);
if (pane.getLayout() == null) {
System.out.println("LayoutManager: " + pane.getLayout());
System.out.println("Test failed");
} else {
System.out.println("Test passed");
}
}
}
------------------output---------------------
LayoutManager: null
Test failed
---------------------------------------------
======================================================================