<Swing Dev> [10] RFR JDK-7042497: javax.swing.JOptionPane.showInternalConfirmDialog throws RuntimeException
Prasanta Sadhukhan
prasanta.sadhukhan at oracle.com
Fri May 12 07:51:49 UTC 2017
Hi All,
Please review a spec violation issue whereby if in
JOptionPane.showInternalConfirmDialog(Component parentComponent, Object
message)
"parentComponent" is null, we are getting RuntimeException
"parentComponent does not have a valid parent"
but as per spec,
https://docs.oracle.com/javase/8/docs/api/index.html?javax/swing/JOptionPane.html
it says "|parentComponent| - determines the |Frame| in which the dialog
is displayed; if |null|, or if the |parentComponent| has no |Frame|, a
default |Frame| is used"
This violation exists for all overridden showInternalConfirmDialog
methods and showInternalOptionDialog.
The proposed fix creates a default JFrame and shows the confirm dialog
in it, as stated in the spec.
Bug: https://bugs.openjdk.java.net/browse/JDK-7042497
webrev: http://cr.openjdk.java.net/~psadhukhan/7042497/webrev.00/
Regards
Prasanta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20170512/c003d7cf/attachment.html>
More information about the swing-dev
mailing list