JOptionPane.showMessageDialog(null, "a String");
我只是想知道 JOptionPane 行中的第一个参数 (null) 意味着什么以及它的用途是什么?
最佳答案
来自Javadoc :
关于第一个参数:
parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, a default Frame is used.
关于java - null 作为 JOptionPane.showMessageDialog 中的参数意味着什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17264792/