RFR: 6328248: JProgessBar doesn't show if printed on paper with PrintJob (1.1 Graphics API) [v3]

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri Feb 20 09:06:35 UTC 2026


On Thu, 19 Feb 2026 18:33:39 GMT, Phil Race <prr at openjdk.org> wrote:

> The bug report says "I note that BasicTabbedPaneUI.java also bails if it's not got a Graphics2D."
> 
> Is that still an issue ? If yes, can it be fixed here ? If yes to the first and no to the second a new bug should be submitted.

I will check and submit a new bug for it if the issue exists..Let this be about ProgressBar only..

> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java line 876:
> 
>> 874:                 g2.setColor(getSelectionForeground());
>> 875:                 g2.clipRect(fillStart, y, amountFull, height);
>> 876:                 SwingUtilities2.drawString(progressBar, g2, progressString,
> 
> surely you can't just skip the drawString ? 
> Also SFAICS that call accepts a Graphics and internally handles printing. Why is it excluded here ? 
> The explanation in the PR description "not to clip progress string" is way too vague.

There was a drawString before that block that draws the full string.
This block fills the color inside the string and there was an issue with that which was basically preventing the string that was inside the progressbar filledpart to be filled with foreground color and the clipped part was rendered white
But that is now resolved with current version..

> src/java.desktop/share/classes/sun/print/PrintJobDelegate.java line 532:
> 
>> 530:             int[][] members = range.getMembers();
>> 531:             jobAttributes.setPageRanges(members);
>> 532:         }
> 
> Hmm. This seems a very odd thing to include in this PR. It it is unrelated.
>  I don't think it should be here and we've managed for 20 years without this null check, so why now ?
> 
> Is it a regression caused by https://github.com/openjdk/jdk/pull/29312/ ?

Yes, it seems so..Clicking "All" will result in NPE so resolved that here..

-------------

PR Comment: https://git.openjdk.org/jdk/pull/29752#issuecomment-3932526895
PR Review Comment: https://git.openjdk.org/jdk/pull/29752#discussion_r2832130554
PR Review Comment: https://git.openjdk.org/jdk/pull/29752#discussion_r2832133268


More information about the client-libs-dev mailing list