RFR: 8343170: java/awt/Cursor/JPanelCursorTest/JPanelCursorTest.java does not show the default cursor

Alisen Chung achung at openjdk.org
Fri Nov 15 13:53:52 UTC 2024


On Wed, 13 Nov 2024 21:56:16 GMT, Damon Nguyen <dnguyen at openjdk.org> wrote:

> the frame isn't part of the original test instructions anyway

The original reproducer didn't have test instructions so it's more likely the person who wrote the instructions just forgot about testing the wait cursor. The idea of the original test is that there was a bug where setCursor works for JComponent and JFrame but doesn't work for JPanel. 

So the left side of this test (move cursor) tests for JComponent,
the bottom right (hand) tests for JPanel,
the button (crosshair) tests for "various swing components",
and if you move the cursor outside all of these components onto the JFrame itself, it would test for the JFrame (wait cursor).

The test instructions probably missed the JFrame section of the test since the area on the test where the JFrame is tested is so small, but I think it is worth keeping it. To make the test area bigger you can set the JSplitPane to be added to the "North" of the frame instead of the "Center" and explicitly setSize(300,200) instead of pack(). If you choose to do this you should also add a step in the instructions to test the JFrame setCursor, something like
`4. Verify that the cursor changes to the wait cursor when outside all other components at the bottom of the JFrame`

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

PR Comment: https://git.openjdk.org/jdk/pull/22055#issuecomment-2478882436


More information about the client-libs-dev mailing list