带有文件路径的 JOptionPane 消息

JOptionPane Message with File Path

有没有办法将文件路径放入 JOptionPane

例如我的项目目录中有一个文件夹,我想获取该文件夹的路径并将其显示到消息中。

JOptionPane.showMessageDialog(null,"your file path,remember to use double slahses instead of single ones");