![]() |
DCIM directory or not, use
javax.swing.filechooser.FileSystemView class. Calling
the usual File.isDirectory() will emit exceptions when
the drive is not accessible.
FileSystemView.getFileSystemView() and instantiate the
FileSystemView class.
FileSystemView.createFileObject(String path) to create a
File object.
File.exists() to
test the directory.
I: drive has DCIM directory.
JPopupMenu.
JMenuItem's.
addActionListener() and add an ActionListener to the JMenuItem.
add() method to add JMenuItem's to the JPopupMenu.
MouseListener to the component from which the popup menu will be invoked.
JPopupMenu.show() method to respond to
mouse press and release actions in mousePressed() and
mouseReleased(). Use isPopupTriggered to
detect a right mouse click.
JMenuItem's are selected in actionPerformed().