JDK-8167303 : Draw JInternalFrame borders by rectangles for floating point UI scale
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • Submitted: 2016-10-06
  • Updated: 2024-09-18
  • Resolved: 2022-02-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
Drawing rectangles using clip and lines can lead that some borders are not drawn for floating point UI scale. See the attached screenshot:
----------------
        g.scale(1.5, 1.5);
        g.setColor(Color.ORANGE);
        drawRect(g, 7, 5, 25, 20);
        drawRect(g, 35, 5, 24, 21);

    private static void drawRect(Graphics2D g, int x, int y, int w, int h) {

        g.setClip(x, y, w, h);
        g.drawLine(x, y, x + w, y);
        g.drawLine(x, y + h, x + w, y + h);
        g.drawLine(x, y, x, y + h);
        g.drawLine(x + w, y, x + w, y + h);

    }
----------------

The JInternalFrame borders should be drawn by rectangles.



Comments
According to [~alexsch]'s comment, the bug is resolved by JDK-8162350. JDK-8015739 fixes border rendering at fractional scale further.
18-09-2024

I think that the priority of this issue can be downgraded to P4 because the main case is fixed by the JDK-8162350. Thanks, Alexandr.
15-11-2016

The fix JDK-8162350 RepaintManager shifts repainted region when the floating point UI scale is used which is on the review (http://mail.openjdk.java.net/pipermail/swing-dev/2016-November/006950.html) fixes the problem with the internal frames moving for floating point scales so updating the JInternalFrame borders drawing is not necessary.
14-11-2016