Open a file by double click with a program written in java

前端 未结 3 1108
长发绾君心
长发绾君心 2021-01-14 23:15

I want to know if it\'s possible to open a file in my program that is written in java just by doing a double click on the file?

For example: On my desktop is a file

3条回答
  •  北海茫月
    2021-01-14 23:26

    "Opening" files by double clicking is a feature of windows OS that is controlled by mapping file extension to specific program.

    If you want to run java program packed in jar file you have to create so called "runnable" jar and map jar extension to program named java or javaw.

提交回复
热议问题