Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8307447

EtchedBorder inset by 1 pixel

XMLWordPrintable

    • generic
    • generic
    • Verified

      ADDITIONAL SYSTEM INFORMATION :
      This affects Java 11.0.19 on Ubuntu (I've logged 11.0.18 because 11.0.19 was not available to select from the release list).

      A DESCRIPTION OF THE PROBLEM :
      EtchedBorder no longer 'borders' a JLabel correctly, instead being inset by 1 pixel along the bottom and right edges. It's a subtle difference - I've included images to demonstrate the difference:

      Java 11.0.18 (correct): <LINK>
      Java 11.0.19 (incorrect): <LINK>

      I only spotted this due to automated screenshot tests which began failing when my Github actions pipeline auto-bumped from 11.0.18 -> 11.0.19. Pinning the version to 11.0.18 has resolved the issue.

      REGRESSION : Last worked in version 11.0.18

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Construct a JLabel with an EtchedBorder and compare the results on 11.0.18 vs 11.0.19

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The EtchedBorder is around the outside of the component.
      ACTUAL -
      The EtchedBorder is inset slightly in the bottom and right edges

      ---------- BEGIN SOURCE ----------
      JLabel label = new JLabel();
      label.setSize(new Dimension(150, 150));
      label.border = EtchedBorder(EtchedBorder.RAISED, null, null);
      label.icon = //some icon...
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Pinning to 11.0.18 has worked around this for me

      FREQUENCY : always


        1. 11_0_18.PNG
          11_0_18.PNG
          49 kB
        2. 11_0_19.PNG
          11_0_19.PNG
          48 kB
        3. Capture.PNG
          Capture.PNG
          11 kB
        4. Main.java
          0.7 kB

            achung Alisen Chung
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: