Usually, there are dedicated applications to view different types of files. However, if you are looking for a viewer that lets you view files of multiple types, you have landed on the correct article.
This class provides an Icon getIcon(File f) method that you can override to return a suitable javax.swing.Icon for the specified File object. After instantiating your FileView subclass, pass it to ...