LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   using default applications from java? (https://www.linuxquestions.org/questions/programming-9/using-default-applications-from-java-335764/)

german 06-21-2005 10:39 AM

using default applications from java?
 
In most operating systems, there's a "default application" for a certain type of file, IE I double click an MP3 and winamp or xmms starts. Is there any way to invoke this behaviour from java (I'd imagine I'd need a third party library), so I can essentially simulate the double click action in code? Actually a better example might be opening a certain MIME type in a web browser and clicking "Open" instead of "Save".

Thanks much

B.

jlliagre 06-21-2005 06:04 PM

Quote:

In most operating systems, there's a "default application" for a certain type of file
Not really, this mapping from file types to application is usually either application or graphic environment dependant. Only windows is an exception to that.

Java is not a graphic environment (like Gnome, KDE and the likes are), so hasn't this feature built-in.
However Java can integrate deeply into some of the graphic environments it can run in with JDIC (https://jdic.dev.java.net/), which is really what you are looking for I guess.
In particular, have a look at the classes org.jdesktop.jdic.desktop.Desktop and org.jdesktop.jdic.filetypes.Association.

german 06-21-2005 11:26 PM

thanks... that is exactly what I'm looking for...

and you're right, my phrasing was incorrect there... most Desktop Environments support default applications.


All times are GMT -5. The time now is 12:06 AM.