1

When using the standard dir dialog box from MATLAB uigetdir, double-clicking on a directory leads to the dialog box entering it and displaying its contents. To actually select it, you have to click on the "select directory" button.

What I would like is a way to add specific rules on what to do when double-clicking on a directory : basically, I would like to change/override the internal 'method/callback' associated to this action.

Problem is, said dialog box is NOT your usual Matlab figure - that I would know how to do easily (retrieve the handle, look at properties and edit/modify the corresponding callback). This looks like a raw Java object and I find no way to access this information from Matlab.

Thanks for your help.

Dev-iL
  • 23,742
  • 7
  • 57
  • 99
Parker Lewis
  • 323
  • 1
  • 9

1 Answers1

1

You could try this, instead of uigetdir:

fc = javax.swing.JFileChooser('/initial/path')
% then customise the dialog using Java methods, as you please!
fc.setFileSelectionMode(javax.swing.JFileChooser.FILES_AND_DIRECTORIES)
chosenfile = fc.showOpenDialog([])

You could even add listener callback to handle specific events if needed.

Sanjay Manohar
  • 6,920
  • 3
  • 35
  • 58