Skip to content

Commit

Permalink
8297450: ScaledTextFieldBorderTest.java fails when run with -show par…
Browse files Browse the repository at this point in the history
…ameter

Backport-of: ea83cb960d07ffa9384aad6a1e2a0233e3ebbdd1
  • Loading branch information
GoeLin committed May 8, 2023
1 parent fafd082 commit b5e6753
Showing 1 changed file with 3 additions and 5 deletions.
Expand Up @@ -246,6 +246,8 @@ private static JComponent createUI() {
childPanel.add(Box.createHorizontalStrut(4));

contentPanel.add(childPanel);
contentPanel.add(Box.createVerticalStrut(4));

if (textFieldSize == null) {
textFieldSize = textField.getPreferredSize();
borderColor = tfBorder.getLineColor().getRGB();
Expand All @@ -254,18 +256,14 @@ private static JComponent createUI() {
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,
(textFieldSize.height + 4) * 4);

panelColor = contentPanel.getBackground().getRGB();

// Save coordinates of the panels
for (Component comp : contentPanel.getComponents()) {
panelLocations.add(comp.getLocation());
}

return contentPanel;
}

Expand Down

1 comment on commit b5e6753

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.