简体   繁体   中英

Show files (Images) in a Java-application

我有一个JPEG文件列表(列出照片),并且希望Windows的默认查看器为该扩展名打开它们,该怎么办?

You can use the java.awt.Desktop class for this:

Desktop.getDesktop().open(new File("image.jpg"));

This will open the image using the default application for opening JPG files on your computer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM