RFR: 8224261: JProgressBar always with border painted around it

Alexey Ivanov aivanov at openjdk.org
Thu Nov 16 12:31:29 UTC 2023


On Thu, 16 Nov 2023 12:23:03 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> It is not necessary to add the progress bar to the frame and then capture the pixels by the robot. you can render content of the progress bar directly to the BufferedImage.
>
> There are a number of tests which do this, scaled borders are those that come to my mind first:
> 
> https://github.com/openjdk/jdk/blob/1d9688667e667dc710d64e52f1e918e047beaca3/test/jdk/javax/swing/border/EtchedBorder/ScaledEtchedBorderTest.java#L300-L311

Another example:

https://github.com/openjdk/jdk/blob/b7425b63f6b69ba8709664377b4e037176ab6139/test/jdk/javax/swing/text/FlowView/6318524/bug6318524.java#L176-L185

Here `textPane` component is painted to the `BufferedImage`. Use the image to analyse rendering.

(In many cases, such a test can run *headless*.)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16467#discussion_r1395621776


More information about the client-libs-dev mailing list