In the Swing JFileChooser you can select multiple files by clicking on the first file, holding down the mouse button and dragging.
Is it possible to enable this method of selecting multiple files in JList too? I have it set to MULTIPLE_INTERVAL so I can select multiple files by holding down shift, but dragging only selects one file.
A JList does not directly support selection by dragging. Also, the file chooser does not seem to support selection by dragging either (at least in the metal or Windows look and feels) unless your are talking about the native file chooser on Windows (in Java 7 it supports multiple selection mode).
Selection by dragging has to be implemented by yourself with a mouse listener. See here for an example that even shows a rubber band.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With