简体   繁体   中英

Display file preview in Java GUI

I have a dialog box which contains a browse button. I have a requirement where I need to browse through a location in my local system and then whatever file the user selects(it may be pdf,doc,excel etc) he/she should be able to preview it in the dialog box itself. Can anyone help me out with this.Any help is appreciated.

In JFileChooser you can use setAccessory : http://docs.oracle.com/javase/7/docs/api/javax/swing/JFileChooser.html#setAccessory%28javax.swing.JComponent%29

Though you'll have to write the preview component yourself. And when it comes to docs and excels it won't be a breeze.

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