[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug swing/23920] setting the layeredPane in a RootPaneContainer causes
From: |
abalkiss at redhat dot com |
Subject: |
[Bug swing/23920] setting the layeredPane in a RootPaneContainer causes weird behaviour |
Date: |
19 Sep 2005 18:47:00 -0000 |
------- Additional Comments From abalkiss at redhat dot com 2005-09-19 18:46
-------
This behaviour is caused because our LayeredPane has a layoutManager attached
and this layoutManager's layoutContainer method is called after
RootLayout.layoutContainer (properly) sets all the sizes. The testcase below
shows 2 problems, the first being that our LayeredPane has a layoutManager
attached while the JDK does not, and the second that our GlassPane uses a
BorderLayout layoutManager while the JDK uses FlowLayout for this.
import javax.swing.*;
import java.awt.Container;
public class TestCase
{
public static void main(String[] args)
{
JFrame jf = new JFrame();
JLayeredPane jl = new JLayeredPane();
jf.setLayeredPane (jl);
jf.setSize(600,600);
JInternalFrame frame = new JInternalFrame("title2", true, true, true, true);
frame.setSize(100,100);
jf.setContentPane(frame);
frame.show();
jf.show();
if (jl.getLayout() == null)
System.out.println ("LAYERED PANE LAYOUT IS NULL");
else
System.out.println ("Layered pane layout:
"+jl.getLayout().getClass().getName());
System.out.println ("glass pane layout:
"+((Container)jf.getGlassPane()).getLayout().getClass().getName());
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23920