Results 1 to 5 of 5
  1. #1
    bobleny's Avatar
    bobleny is offline Member
    Join Date
    Apr 2008
    Posts
    50
    Rep Power
    0

    Default How do I open a file with a class, or can I?

    I am trying to make a program, where when I double click on an xml file, it will load up my program. My program then need to know the name and location of the xml file.

    What I am clueless at is the part where I retrieve the name and location of the file. I just don't know how this part works.

    The idea is to open foo.xml with xmlFilter.class? xmlFilter.class would then use the filename and location to perform various tasks...

    This is something completely new to me, and I greatly appreciate all of your help!
    -- www.firemelt.net --
    Cheer up, the worst has yet to come...

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    In basis, to open a file in double-click you should have an executable file installed in the Windows OSs. So you have to think about that how to workaround with your application. But it cannot be the best approach. Because of other OS, like Linux and so on.

  3. #3
    bobleny's Avatar
    bobleny is offline Member
    Join Date
    Apr 2008
    Posts
    50
    Rep Power
    0

    Default

    Well, I know I could probably use a batch or shell script to lunch it from the command line without any problems...

    I would really like to do it like the "big programs" do it. Does notepad, word, or firefox use a batch script to launch?

    That and I only learn by doing...

    Fortunately, this program only has to run on windows...
    -- www.firemelt.net --
    Cheer up, the worst has yet to come...

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Most of the applications have specific start-up process. May be a batch file or something else(script).

  5. #5
    bobleny's Avatar
    bobleny is offline Member
    Join Date
    Apr 2008
    Posts
    50
    Rep Power
    0

    Default

    Well, I'm not going to worry about it now... I just thought it would be neat that way.

    Anyways, I got to get this stupid thing to work via command line before I can make a batch file for it...

    This program is killing me!

    Thanks for your response though.
    -- www.firemelt.net --
    Cheer up, the worst has yet to come...

Similar Threads

  1. Replies: 4
    Last Post: 02-16-2009, 03:20 PM
  2. how to open a file through URL
    By katie in forum New To Java
    Replies: 3
    Last Post: 07-13-2008, 02:53 AM
  3. Open File
    By JavaLerner in forum SWT / JFace
    Replies: 5
    Last Post: 07-12-2008, 06:41 PM
  4. To open an image file such as Jpeg file using JAva Program
    By itmani2020 in forum Advanced Java
    Replies: 10
    Last Post: 07-11-2008, 09:57 AM
  5. Is it possible to open a txt file?
    By jason27131 in forum New To Java
    Replies: 20
    Last Post: 08-07-2007, 01:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •