Current Position:Home > Open files with java

Open files with java

Update:11-30Source: network consolidation
Hi I'd like to know if there's a way that you can open a file that's been associated with your java app. I know how to read from a file and I know how to pass command line arguments but what I don't know is how to open my app with a file just by clicking it in my file browser. If needed i could settle for a Mac-specific and a Windows-specific method.

The Best Answer

This is nothing to do with Java, and specific to the OS you're installing to. This question comes up quite regularly, from people who are under the impression it's the responsibility of their app to enforce the file association. It isn't. Your installation should ask users if they want the association made. Remember how annoying it is when something you've just installed takes over the file associations of another app, without asking? Don't do it, your users won't like it
  • Creation of .RTF file in java Update:10-11

    Hi, I want to create/edit .RTF file through java application. In my RTF file, I should be able to edit data(formatting), inserting tables. This is already done. Now I want to create chart (like pie-chart) using java. I searched the net for the last c

  • Generation of XML file from Java objects using castor Update:10-11

    I have the following java file( public class Customer      private String ID;      private FirstName firstName;      private MiddleName middleName;      private LastName lastName;      private ArrayList address;      public ArrayList g

  • Generation of xml file from java code Update:10-11

    hi, I want to manipulate data in a xml file with java code.I have read data from xml file and also changed it. But i am unable to covert it again in xml file from java code. Can you please tell me how i can do this?Let me know which parser are you us

  • Error reading zip file in Java 6 Update:10-11

    We have a bespoke installer program that fails, intermittently, in Java 6 on Windows. After installing some files, it then fails with a stack trace like this: error reading zip file      at

  • How to read Excel file in java Update:10-11

    Respected sir/madam I want to read the values from Excel file in Java program. How can I do that. When I searched over the net I came to know that you can treat Excel file as a Database and write the code as u write for making DB connections . I did

  • Executing batch file from Java stored procedure hang Update:10-11

    Dears, I'm using the following code to execute batch file from Java Stored procedure, which is working fine from Java IDE JDeveloper public static String runFile(String drive) String result = ""; String content = "echo off\n"

  • JNI Invocation: open file in Java, write file in CPP Update:10-11

    Hello, Warning: I am a dunce, bad CPP code ahead! Using JNI invocation, I am trying to read a binary file in Java and write it in CPP. Everything compiles and runs without error, but the input and output jpg files are of course different. TIA to any

  • How to read pdf files using package classes Update:10-11

    Dear All, I have a certain requirement that i should read and write PDF files at runtime. With normal java file IO reading is not working. Can any one suggest me how to proceed probably with sample code block Thanks in advance.hi I also have the pbm.

  • Create crystal report file using JAVA Update:10-11

    Can someone tell me how to a Create crystal report file using JAVA Programming I want a very simple examplePlease help me. It's urgent.[] Be back in an hour or two...Read other 2 answers

  • How to create and edit a .ini file using java Update:10-11

    Hi All... Pls help me in creating and editing an .ini file using java... thanks in advance Regards, sathyaLet's assume the ini file is a mapping type storage (key=value) so lets use Properties object. (works with java 1.4 & up) import; i