8154846: SwingNode does not resize when content size constraints are changed

Reviewed-by: prr, angorya, arapte
This commit is contained in:
Prasanta Sadhukhan 2023-10-16 09:01:57 +00:00
parent 37aed6f46d
commit 37eb98604f

View File

@ -370,13 +370,6 @@ public final class JLightweightFrame extends LightweightFrame implements RootPan
}
};
contentPane.setLayout(new BorderLayout());
contentPane.add(component);
if ("true".equals(AccessController.
doPrivileged(new GetPropertyAction("swing.jlf.contentPaneTransparent", "false"))))
{
contentPane.setOpaque(false);
}
setContentPane(contentPane);
contentPane.addContainerListener(new ContainerListener() {
@Override
@ -396,6 +389,15 @@ public final class JLightweightFrame extends LightweightFrame implements RootPan
}
}
});
contentPane.add(component);
contentPane.revalidate();
contentPane.repaint();
if ("true".equals(AccessController.
doPrivileged(new GetPropertyAction("swing.jlf.contentPaneTransparent", "false"))))
{
contentPane.setOpaque(false);
}
setContentPane(contentPane);
}
@SuppressWarnings("deprecation")