Opening a file in a Java application

Hi everybody,
I've written a simple text editor, and this editor saves files with a particular extension. It can both open and save files. I've put the text editor program in a JAR. What I'd like to do, if possible, is associate the file extension with the text editor program. That is, I'd like to, when I click on a file with the extension, have the text editor come up with the file opened in it.
Can anyone give me ideas on how to do this, please? I'm not sure if it's a programming issue, operating system issue, Swing issue, or some combination of all three, honestly. If it will help, I'm using Windows XP.
Thanks,
Jezzica85

>
I've written a simple text editor, and this editor saves files with a particular extension. It can both open and save files. I've put the text editor program in a JAR. What I'd like to do, if possible, is associate the file extension with the text editor program. That is, I'd like to, when I click on a file with the extension, have the text editor come up with the file opened in it.
Can anyone give me ideas on how to do this, please? >If the editor is launched using webstart, the launch file can suggest a file association.
Note that an application that accesses the local file system needs to be digitally signed before it can break out of the applet like 'sandbox' in which it runs, unless it uses the JNLP API to access the files. The JNLP API is available to any app. launched using webstart.
There is an example of both claiming a file extension, and accessing files using the JNLP API, in this [File Service Demo|http://pscode.org/jws/api.html#fs]. The complete source and a build file can be downloaded from the filetest.zip just near the launch buttons.
I suggest you try the sandboxed version first - if you think that will suit your user, go with that.
As an aside, for best chance of a solution, I recommend folks add [Duke stars|http://wikis.sun.com/display/SunForums/Duke+Stars+Program+Overview] to match the importance of the task.

Similar Messages

  • Help - "Acrobat is being used by another application and cannot open PDF files until the other application is closed."

    Hello,
    I searched this site and google for this error terminology and come up dry.  I support a user who has been for years using Acrobat 5 (yes, I know...) to read files in a client DB program, as well as other PDF files on their PC.  In the last week or so, they have started gatting this error "Acrobat is being used by another application and cannot open PDF files until the other application is closed." any time they attempt to open a PDF file attached to an email (via Outlook).
    It is my understanding that they cannot upgrade to a newer version of Acrobat because of limitations of their client software, but had not previously had any issues viewing PDF notes from the DB, and PDF attachments in their email.
    I have tried uninstalling and re-installing, as well as tried using Adobe Reader 7 & 9 in conjunction with Acrobat to try to get around this issue, but have not been successful.
    Any ideas?
    Thanks,
    Jesse

    I don't have an answer to your technical problem. The product I assume is Acrobat that you are talking about (based on the post title), Adobe is the company name. This is a good place to ask questions on Acrobat if folks can figure out what you are talking about. They will ask for the product version number (like AA9.3.3), operating system, and other applications if appropriate. Also, just what you are doing that generates the message.
    As for Adobe, you are not likely to get an answer from them here in the user forum. You will be lucky if you can get an answer if you can contact them and not be on hold for more than an hour (sorry, this is why a lot of folks end up in the forum).
    So, to help others try to answer your question, what are the products and versions involved? What OS? What are you doing when the message comes up.

  • How to create a .exe file for a java application

    Hi, I want to create a .exe file for a java application I am developing so that I can schedule it to run at a particular time using Windows Scheduler on WinNT. Is there any way to accomplish this? Or is there any other way in which a Java application can be scheduled to run at a particular time on Windows everyday?

    Create a .bat file and run that. Just have, in the .bat file:
    java YourClassName Alternatively, you can use javaw YourClassName (without *.bat, just put it into Windows Scheduler like suggested above).
    using javaw won't pop up any window...

  • Opening a file in its native application from Flex.

    Is it possible to open a file on whatever native application the user runs it as?  Or even, at that, to simply open the directory it's in, in an explorer window?
    We have a search application and the frontend is in Flex, and I'm trying to find a way to do this, such that when a use double clicks on a result (in a datagrid - but that's trivial), it opens the file or at least the location of the file on the OS.
    Any system call where I can say system("explorer.exe " + filepath); or something?
    Any help would be appreciated.

    Dear BillBlalock ,
    thank you for answer!! You are very kind and helpful!! I would like to inform everybody that I have finally find another way of soilving my problem and I announce it to the forum in case somebody else encounters the same problem. Well, I soved the nproblem by using the following code:
        excelButton.addActionListener(new ActionListener()
           public void actionPerformed(ActionEvent e)
             String filePath = "\""+saveFileName.toString()+"\"";
             System.out.println(""+filePath);
             try
               String cmd="explorer "+filePath;
               Process p = Runtime.getRuntime().exec(cmd);
             }catch(IOException ec){}
         });I hope it can be useful to somebody!! By this code, I can make a button (in my case the excelButton) to open any file in its default application. Keep up the great work you are doing guys!!

  • HT2041 I receive an error message when opening up a downloaded program as "Safari can't open the file because no availabel application can open it". Not sure what exactly this means or what I have to do!

    I receive an error message when opening up a downloaded program "safari can't open the file because no available application can open it" I am not sure what I need to do to get these programs open!

    What is the file?
    Where did you get it from?
    Allan

  • Open a file into a java app - HOW DO YOU DO IT!!

    I have written an html/php editor - I want to set it up so that when you double click on a php file in windows it will open the file into my java ide.
    I know this can be done - but how!!! There does not seem to be any info on the web about it - can anyone give me some pointers.
    Thanks

    Yeah - but the problem is: You can only set files to
    open with a .exe file - if you go to the settings and
    set the .php file to "open with" you have to select a
    .exe file e.g. notepad.exe
    However you can't create .exe files in java!!!! So how
    do you do it?You have to spend $$$'s
    However many /most converters don't work without the relevant updated JVM (but they are *.exe, kind of)

  • I can`t open jar files though my java version is updated

    Hello everybody, I`m using Macbook Pro 13` with Lion on it.
    As it says in the title, I can`t open jar files though, my java version is updated.
    It says, I shuld check the console.
    Right now, my java version is, "1.7.0_15", and i`m trying to open a jar file created 3 days ago, by some developer.
    Although, if im trying to open jar file created 1 year ago, it doe`s open.
    Why is that? and, How can i fix it?
    Thanks.

    Franeo wrote:
    Hello everybody, I`m using Macbook Pro 13` with Lion on it.
    As it says in the title, I can`t open jar files though, my java version is updated.
    It says, I shuld check the console.
    With Java 6 and prior, you had to enable logging first before you could view error messages in Console.  I am guessing that you need to check the Java Control Panel to see if logging is turned on.

  • Can we run the batch file using simple java application

    Hello sir,
    we want to run the batch file using simple java application. i tried with some example, we run the exe files but not batch file.
    Runtime r = Runtime.getRuntime();
    r.exec("D:\\jboss\\bin\\run.bat");
    My application is server will run when we run the java appliation.
    any suggestion? plz give me the solutions

    yes you can run html file
    WEB.SHOW_DOCUMENT is a built-in that is used in Forms to call URL from a Web Form. It works much like the similar way that a link on an HTML page works and it takes two arguments, one is URL and second one is TARGET, in your case use following.
    WEB.SHOW_DOCUMENT('http://channas.iil.informatics.lk:8890/forms/frmservlet?config=abc.html', '_blank');
    Hope this will work for you
    Abbas

  • How to Open or load the swf file only in Java application

    Hai.,
         How I Secure my Flash SWF files(AS2 and AS3).?
         The SWF files are only work through java application. When the java call the swf file that time only it will work otherwise it won't work including browsers also..

    I attached the file to this post. It would be great if you could send me the pdf version of the block diagram. It's not totally finished, but that doesn't matter, I can complete it in school.
    Thank you, really, thank you.
    I know that this is not the purpose of this forum, but it was the easiest solution for my problem.
    Attachments:
    Programma transportmiddel.vi ‏129 KB

  • Creating an xdp file from flex/java application

    Hi,
    I have an application in Flex 4  and As 3.When I click a button in flex application I have to generate a file in java with
    extension xdp.When I try this locally(Run as java application) the file is generating  correctly.When i compile the applic
    ation and try it, the file is not writing correctly.Do someone have any idea about creating an xdp file from flex application?
    i am using blazeds to connect java and flex4.When i opens the file in notepad the file is writing correctly.There is only problem in openig an xdp file...
    please help me.

    specifically:
    Runtime.getRuntime().exec("filename.exe")

  • How to open JSP session from a java application or an applet?

    Hi,
    My problem is a bit challenging (at least for me) and its not about JSP but it is about a web application..
    I couldnt find a better place to post this question I am sorry if this is not the right place to post it..
    I need to enable users log into my website by checking username and password and reading and checking the data from a usb device located in client computer.
    I can read from the device thorough JNI using the third party DLL file for the device... I have no problem with that..
    Since I need to make native calls I am planning to develop a java application so I let the users open the application using web start.. Once my application is running on client side after reading the device and getting login password information (assuming login information correct), How can I open a web session for the that spesific user and a web browser and let the user browse the web site on his/her own session?
    I would appreciate any guidance..
    Thanks..

    add the values in the header using...
    response.addHeader("userNmae","XXXX");use it in all ur pages like say..
    if(!request.getHeader("userName")!=null && request.getParameter("userName").equlas(""))
    String username=request.getParameter("userName");
    }

  • MAXIMUM NUMBER OF OPEN TXT FILES(notepad) IN JAVA

    I have a java application, the program visits about 200-300 links and parses the data and writes them to about 40 to 200 txt files, sometimes when it has to open 80 or more txt files and write the parsed datat to them the program freezes for 3-5 minutes, is there a limit to how many txt files a java application can open?
    Any ides what causes this problem?
    If it has to open 50 or less txt files then it works fine

    More information regarding my problem:
    Whenever the application freezes for 2-4 minutes and then restarts if I reboot my PC and try again it works fine when I run it 3-4 times and then if I try again the freezing/restart problem occurs again, if I reboot again it runs finr the first 3-4 times and then the problem returns,...
    What do you guys think?
    Thanks

  • Open default browser from a java application

    How is possible to make a java application that open an html file in the default browser ?
    Thankyou
    [email protected]

    You can do that by running the command "start <url>", for example using Runtime.exec().
    Runtime.getRuntime().exec("start http://java.sun.com");Jesper

  • Unable to open CS3 Files from within the application

    Good Afternoon
    I work as IT Support for company looking after 10 ADOBE Creative Suite 3 end-users.
    One of my colleagues is unable to open Illustrator or Photoshop files from within their respective applications, but she is able to open them from outside ok.
    I have reinstalled ADOBE CS3 and this appeared to resolve the issue, only for it to return again a day later.
    She has no other applications or processes running during her attempt to open a file from within CS3.
    She will click on Open and the 'Open File' window will flash up for a split second, then the whole application will be frozen. It is as if the 'Open File' window is there, but isnt there because we cant click on it, but the application thinks it is displaying and so she can not click on anything else. The only way to close the application is to end the process under Task Manager.
    While I am sitting here tearing what little amount of hair I have on my head, can anyone point me in the right direction?
    Is this a Windows problem or an ADOBE problem do you think?
    I look forward to any replies.
    Thank you

    Hi Bob
    Ok...
    Opened illustrator but was unable to open the 'Open File' window.
    Changed the screen resolution, it suddenly worked!
    Changed the screen resolution back to as it was before, it also worked.
    What could cause this do you think?
    By simply changing the screen resolution and back again, the 'Open File' window displayed itself.
    Very bizarre!

  • How can I force Firefox to open webm files in a external application like mplayer?

    I want to open webm files from browsing sites (for example tagesschau.de) in mplayer through 'xterm -e' where I set a specific placement of the window and other parameters. Setting media.webm.enabled to false only disabled internal player, but does not open any option under Preferences -> File Types. Playing with advanced configuration I tried creating media.webm.handler{,default,application} according to other file type that are set to external applications. No luck. I have set mp4 files to use the same script (with execution permission) and it works exactly as I want.
    Script:
    <pre><nowiki>#!/bin/bash
    FILENAME="`basename "$@"`"
    xterm -fs 24 -bg black -fg white -title "$FILENAME" -geometry 96x8 -e "echo \"$FILENAME\"'\\nfrom\\n'\"$@\" && \
    mplayer -geometry 100%:100% -vf dsize=400:-3 -volume 80 \"$@\" "</nowiki></pre>
    The script itself works when I feed it a webm url (or any other media for that fact).
    Linux 3.9.9-1-ARCH x86_64 GNU/Linux

    I don't know about linux cos i'm win user. But you may start with disabling internal webm support. about:config -> media.webm and then I think you should install greasemonkey addon and custom script for playing content in 3rd partys players. (At least that is my configuration. I'm using VLC for youtube)

Maybe you are looking for

  • Oracle EBS 11.5.10.2 not working in IE 9 on Windows 7 64-Bit

    Hi, I upgraded our Oracle EBS(11.5.10) to 11.5.10.2+DB 11g R2+Sun JRE. Some users having IE 9 on Windows 7 (64-Bit) are not able to access the Forms based products, though this combination is mentioned in Note: 290807.1. Please let me know if any wor

  • Startpage ok,now links from email are not.

    Startpage ok now but can't access links from email. Everytime I do this I'm asked to make changes to the computer then an error box appears,I click ok and Then it works.this happens every time on every email link

  • Can't see video in an Avid Meridien Clip with codecs installed.

    Hey all, any help would be greatly appreciated. Here's my issue. i have two computers described below, both have many avid codecs on them i'll list those below too. Neithe of them can show a clip that was exported out of an Avid even with the codecs

  • Using triggers with software timing

    Hello I'm using the PCI-6259  M series multifunction DQ board on a linux box (SLES 10.2) and am using the ansi_c api and the driver is NI KAL 1.4.  My application requires 10 analog inputs, 8 digital inputs 8 digital outputs and all 4 analog outputs

  • Problems with partition tables

    Hi all, I've got some problems with partition tables. The script at the bottom run but when I wanna insert some values it returns me an error (ORA-06550: line 1, column 30: PL/SQL: ORA-06552: PL/SQL: Compilation unit analysis terminated ORA-06553: PL