File tree Expand file tree Collapse file tree 2 files changed +19
-14
lines changed
src/main/kotlin/com/github/igr/sexyeditor/ui Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ dependencies {
4040 }
4141}
4242
43- // Use Java 11 for 2020.3+, and Java 17 for 2022.2+ .
43+ // Set the JVM language level used to build the project .
4444kotlin {
4545 jvmToolchain(21 )
4646}
Original file line number Diff line number Diff line change @@ -389,23 +389,28 @@ open class EditorConfigUI {
389389 }
390390 scrollPane.setViewportView(fileList)
391391
392- fileList.dropTarget = object : DropTarget () {
393- @Synchronized
394- override fun drop (evt : DropTargetDropEvent ) {
395- try {
396- evt.acceptDrop(DnDConstants .ACTION_COPY )
397- val droppedFiles = evt.transferable.getTransferData(DataFlavor .javaFileListFlavor) as List <File >
398- for (file in droppedFiles) {
399- fileListModel.addElement(
400- ImageFile (
401- file.absolutePath
392+ try {
393+ fileList.dropTarget = object : DropTarget () {
394+ @Synchronized
395+ override fun drop (evt : DropTargetDropEvent ) {
396+ try {
397+ evt.acceptDrop(DnDConstants .ACTION_COPY )
398+ val droppedFiles = evt.transferable.getTransferData(DataFlavor .javaFileListFlavor) as List <File >
399+ for (file in droppedFiles) {
400+ fileListModel.addElement(
401+ ImageFile (
402+ file.absolutePath
403+ )
402404 )
403- )
405+ }
406+ } catch (ex: Exception ) {
407+ // this is a workaround to make Intellij build work
408+ ex.printStackTrace()
404409 }
405- } catch (ex: Exception ) {
406- ex.printStackTrace()
407410 }
408411 }
412+ } catch (ignore: java.awt.HeadlessException ) {
413+ // Ignore, this is a headless exception
409414 }
410415 return fileList
411416 }
You can’t perform that action at this time.
0 commit comments