On Wed, 24 May 2023 19:32:52 GMT, Alexey Ivanov <[email protected]> wrote:
>> 1) Used builder pattern
>> 2) Tested AWT tests and it passed
>
> test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 309:
>
>> 307: JOptionPane.showMessageDialog(frame, "Screen Captured " +
>> 308: "Successfully", "Screen Capture",
>> 309: JOptionPane.INFORMATION_MESSAGE);
>
> Suggestion:
>
> JOptionPane.showMessageDialog(frame,
> "Screen captured successfully",
> "Screen Capture",
> JOptionPane.INFORMATION_MESSAGE);
>
> It's better not to split strings unnecessarily. The messages usually use
> regular capitalisation as opposed to title capitalisation.
@aivanov-jdk, @lawrence-andrew
> If the displayed message isn't modal, like a tooltip or a notification which
> disappears automatically after a certain time, it could be better
> appreciated. But it's harder to implement.
We could use Timer for disappearing messages, but might be an overkill here.
JOptionPane pane = new JOptionPane("Screen capture successful",
JOptionPane.INFORMATION_MESSAGE);
final JDialog dialog = pane.createDialog("Screen Capture");
Timer timer = new Timer(2000, e -> dialog.dispose());
timer.setRepeats(false);
timer.start();
dialog.setVisible(true);
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14094#discussion_r1207245091