| | |
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 actionlistener android api applet application array automation bi binary blackberry block bluetooth character class client code compile compiler component consumer database desktop developmenthelp eclipse error fractal freeze ftp functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide image int j2me j2seprojects java javac javaee javaprojects jetbrains jni jpanel jtable julia learningresources lego linked linux mac main map method mobile myregfun netbeans nonstatic notdisplaying number online pearl printf problem program project qt researchinmotion rotatetext rsa scanner screen server set singleton sms sort spamblocker sql string swing system textfields thread threads time title tree tutorial-sample update variablebinding windows working xor





