سؤال

I want it like when we do "open with" and then choose Notepad. So that when I "open with" a file there will be my program in the list. How to associate a file type with my program?

How to make the program handle the file?

هل كانت مفيدة؟

المحلول

Deploy the app. using Java Web Start.

Java Web Start (JWS) is the Oracle Corporation technology used to launch rich client (Swing, AWT, SWT) desktop applications directly from a network or internet link. It offers 'one click' installation for platforms that support Java.

JWS provides many appealing features including, but not limited to, splash screens, desktop integration, file associations, automatic update (including lazy downloads and programmatic control of updates), partitioning of natives & other resource downloads by platform, architecture or Java version, configuration of run-time environment (minimum J2SE version, run-time options, RAM etc.), easy management of common resources using extensions..

This demo. of the file service is deployed using JWS (on OS X, *nix and Windows) and declares an interest in the .zzz file-type.

نصائح أخرى

Best thing would be to create an EXE wrapper for your Java program:

How can I convert my Java program to an .exe file?

and

Best free tool to build an exe from Java code?

are relevant. Then you would need to create a file association. See this KB article on how to do it manually: http://support.microsoft.com/kb/307859

If you use an installer package to package your app you would have to research on how to accomplish this automatically when your program installs.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top