On Fri, 30 Oct 2026 08:09:41 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: > > fix test/jdk/java/awt/PrintJob/PrintProgressBarTest.java line 73: > 71: private static final String VERT_INSTRUCTIONS = """ > 72: This test shows a frame with 2 vertical progressbars > 73: with LTR and RTL orientation respectively and a "Print" button. There is no difference. In vertical mode, it always fills from the bottom. So you need to do something different here or a tester will call this a fail. I would have just added a 3rd progress bar to the test which is documented to be vertical and no mention of LTR / RTL in that case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/31749#discussion_r4426705474
