Balwant Kumar Singh
Balwant Kumar Singh

Reputation: 1178

Swing - JFileChooser open dialog does not show images for various options

I'm using JFileChooser API for opening a file. When open dialogbox appears, it does not show images for various option like, Up one lever, Create new Folder, List, Details. Some of the option is also not visible untill mouse hover. Here is the image : enter image description here

My code looks something like this:

JFileChooser fileChooser = new JFileChooser();
FileFilter xlsExcelType = new FileNameExtensionFilter("Excel spreadsheet (.xls)", "xls");
FileFilter xlsxExcelType = new FileNameExtensionFilter("Excel spreadsheet (.xlsx)", "xlsx");
fileChooser.addChoosableFileFilter(xlsExcelType);
fileChooser.addChoosableFileFilter(xlsxExcelType);

fileChooser.setFileFilter(xlsxExcelType);

int returnVal = fileChooser.showOpenDialog(null);

if (returnVal == JFileChooser.APPROVE_OPTION)
{
    File file= fileChooser.getSelectedFile();
}

Kndly pass your idea to make those option visible with image. Thanks

Upvotes: 2

Views: 505

Answers (1)

Catalina Island
Catalina Island

Reputation: 7136

Look and see if java.awt.FileDialog has the option(s) you want. If not, you might try ideas from here or here.

Upvotes: 1

Related Questions