8297450: ScaledTextFieldBorderTest.java fails when run with -show parameter

Reviewed-by: aivanov, honkar
This commit is contained in:
Rajat Mahajan 2022-12-06 18:43:02 +00:00 committed by Harshitha Onkar
parent 336d230a39
commit ea83cb960d

@ -246,6 +246,8 @@ public class ScaledTextFieldBorderTest {
childPanel.add(Box.createHorizontalStrut(4));
contentPanel.add(childPanel);
contentPanel.add(Box.createVerticalStrut(4));
if (textFieldSize == null) {
textFieldSize = textField.getPreferredSize();
borderColor = tfBorder.getLineColor().getRGB();
@ -254,6 +256,7 @@ public class ScaledTextFieldBorderTest {
textField.setBounds(i, 0, textFieldSize.width, textFieldSize.height);
childPanel.setBounds(0, (textFieldSize.height + 4) * i,
textFieldSize.width + i + 4, textFieldSize.height);
panelLocations.add(childPanel.getLocation());
}
contentPanel.setSize(textFieldSize.width + 4,
@ -261,11 +264,6 @@ public class ScaledTextFieldBorderTest {
panelColor = contentPanel.getBackground().getRGB();
// Save coordinates of the panels
for (Component comp : contentPanel.getComponents()) {
panelLocations.add(comp.getLocation());
}
return contentPanel;
}