| | |
open unknown file types through java
Thread Solved |
•
•
Join Date: Aug 2008
Posts: 4
Reputation:
Solved Threads: 0
Hello
Please help me with the following: i am trying to open a file with a specific application using java. I am working on a desktop application.
The following code using java.awt.Desktop works for known extension types,but when trying to open a file with an unknown extension it throws an exception. I know this is about to happen, because it's in the class documentation, but what i want to ask you is if there is another way of popping up the windows "open with" dialog through java. I just don't want to let unknown extension file types untreated. This is the code i use, and it works,just that it throws an exception for unknown file types:
Thank you very much
Please help me with the following: i am trying to open a file with a specific application using java. I am working on a desktop application.
The following code using java.awt.Desktop works for known extension types,but when trying to open a file with an unknown extension it throws an exception. I know this is about to happen, because it's in the class documentation, but what i want to ask you is if there is another way of popping up the windows "open with" dialog through java. I just don't want to let unknown extension file types untreated. This is the code i use, and it works,just that it throws an exception for unknown file types:
java Syntax (Toggle Plain Text)
import java.awt.Desktop ... if (Desktop.isDesktopSupported()) { desktop = Desktop.getDesktop(); temp = new File(localPath); desktop.open(temp); }
Thank you very much
•
•
Join Date: Dec 2007
Posts: 43
Reputation:
Solved Threads: 3
use the JFileChooser , but that is swing ,
just google and find something about JFileChooser example
http://java.sun.com/docs/books/tutor...lechooser.html
will help you ,
just google and find something about JFileChooser example
http://java.sun.com/docs/books/tutor...lechooser.html
will help you ,
![]() |
Similar Threads
- Java Client/Server (Java)
- HJT Log file (Viruses, Spyware and other Nasties)
- My Log (Viruses, Spyware and other Nasties)
- windows 2000 IE 6. need help to remove spyware (Viruses, Spyware and other Nasties)
- This Should be Easy for You Guys! (Linux Servers and Apache)
- Trojan Horse Downloader.small.44.bw & 44.j (Viruses, Spyware and other Nasties)
Other Threads in the Java Forum
- Previous Thread: applet not initialized
- Next Thread: Inter Thread Communication!
| Thread Tools | Search this Thread |
-xlint add android api applet application applications array arrays automation bank bi binary blackberry bluetooth chat class client code compile compiler component database development digit eclipse equation error event fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image infinite input int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list login loop main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying pearl problem program programming project qt recursion scanner screen scrollbar server set sms sort sorting spamblocker sql sqlserver string superclass swing system text-file thread threads tree variablebinding windows xor





