RFR: 8235404: [macos] JOptionPane blocks drawing string on another component

Harshitha Onkar honkar at openjdk.org
Thu Aug 1 23:54:03 UTC 2024


On Fri, 26 Jul 2024 16:52:44 GMT, Alisen Chung <achung at openjdk.org> wrote:

> Currently if you try to use graphics to draw a string on a frame using JOptionPane + JTextField with a listener as a prompt, the string will not draw. Adding a repaint after dialog.dispose in JOptionPane will cause the text to show after the dialog is closed.

The test requires clean-up there are couple of commented lines.
JBS issue does not seem to be linked, can you check by adding.
`/issue add 8235404`
Test summary in jtreg needs an update

test/jdk/javax/swing/JOptionPane/OptionPaneInput.java line 86:

> 84:         f.setSize(300,100);
> 85:         PassFailJFrame.addTestWindow(f);
> 86:         PassFailJFrame.positionTestWindow(f, PassFailJFrame.Position.HORIZONTAL);

The JOptionPane can be add as a split window using PassFailJFrame.splitUI() since currently it gets blocked by the testUI.

test/jdk/javax/swing/JOptionPane/OptionPaneInput.java line 89:

> 87:         f.setVisible(true);
> 88: 
> 89:         JOptionPane.showMessageDialog(null, t);

Since parentComponent of JOptionPane is null running into NPE.


        parentComponent.revalidate();
        parentComponent.repaint();

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

Changes requested by honkar (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/20359#pullrequestreview-2214212950
PR Review Comment: https://git.openjdk.org/jdk/pull/20359#discussion_r1700999612
PR Review Comment: https://git.openjdk.org/jdk/pull/20359#discussion_r1700994254


More information about the client-libs-dev mailing list