On Fri, 31 Jul 2026 03:49:28 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 two 
> additional commits since the last revision:
> 
>  - Vertical progressbar print
>  - Vertical progressbar print

Vertical progress bar progress string rendering needs a Graphics2D object to do 
the transform so I had to pass Graphics2D object to paintString so had to use 
BI graphics object to pass onto paintString so paintString change is 
reverted... I guess it will bring back the "blocky" behaviour you were talking 
about but to make vertical bar work, I guess this change is needed

Let me know if we can some other way

Vertical bar printout with LTR and RTL
<img width="379" height="621" alt="image" 
src="https://github.com/user-attachments/assets/e3d64248-5a85-464f-a915-bfc5eba511c2";
 />

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

PR Comment: https://git.openjdk.org/jdk/pull/31749#issuecomment-5139067164

Reply via email to