On Wed, 19 Aug 2026 07:43:15 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>> [JDK-6328248](https://bugs.openjdk.org/browse/JDK-6328248) fixed PrintJob 
>> (1.1 Graphics API) based JProgressBar printing for most L&F however it seems 
>> to cause ClassCastException in AquaProgressBarUI.paint as non-Graphics2D 
>> path was not handled
>> `Caused by: java.lang.ClassCastException: class sun.print.ProxyPrintGraphics 
>> cannot be cast to class java.awt.Graphics2D (sun.print.ProxyPrintGraphics 
>> and java.awt.Graphics2D are in module java.desktop of loader 'bootstrap') `
>> 
>> FIx is made to render Aqua progress bar into BufferedImage, then drawImage 
>> for non-Graphics2D case where 1.1 PrintJob is used
>> 
>> 
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Prasanta Sadhukhan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Windows Progrssbar fix

Marked as reviewed by prr (Reviewer).

Oh I take that back about vertical working. The text is blocky.

test/jdk/java/awt/PrintJob/PrintProgressBarTest.java line 71:

> 69:     private static JFrame createTestUI() {
> 70:         JPanel panel = new JPanel(new FlowLayout());
> 71:         JProgressBar ltrBar = new JProgressBar();

iI won't insist, but would have been nice to test VERTICAL too.
I tried it and it does work although the test doesn't layout well in that case, 
and also Swing doesn't seem to know what to do with RTL in that case.

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

PR Review: https://git.openjdk.org/jdk/pull/31749#pullrequestreview-5419359871
Changes requested by prr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/31749#pullrequestreview-5419372554
PR Review Comment: https://git.openjdk.org/jdk/pull/31749#discussion_r4187752279

Reply via email to