Reputation: 81
I have recently started learning java and I am working/improving on a java IDE. I'm trying to find a way so that when you double click a file, the file is automatically opened with my program.
So far the only way I have found to do that is by using the apple extension com.apple.eawt (question found here). The only problem is that I have JDK 1.8 and this extension no longer works. Following this question, I looked for it on my computer and I believe it was last included in JDK 1.6.
My questions are: is there a way to use this extension in java 1.8? Or is there an Apple or non-Apple replacement that will do the same?
Upvotes: 3
Views: 1758
Reputation: 20565
com.apple.eawt
in the java.awt.Desktop
classFor instance, you pointed to a question that recommended using Application.getApplication().setOpenFileHandler(myOpenHandeler)
.
This is equivalent to Desktop.setOpenFileHandler(OpenFilesHandler openFileHandler)
.
This functionality is also now available on platforms other than macOS, such as Windows.
Upvotes: 5