Results 1 to 6 of 6
- 10-07-2008, 03:53 AM #1
Member
- Join Date
- Oct 2008
- Posts
- 1
- Rep Power
- 0
- 10-07-2008, 04:24 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
First of all you have to find what is the default text editor is. I think on Windows it's Notepad. So you can use Runtime class, with Notepad.exe. For Linux and UNIX systems there is a common way to do it. Just Google it, I'm not remember what it is. Anyway you have to use the Runtime class there too.
- 10-07-2008, 05:06 AM #3
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
If you have 1.6 or later, read the API docs for the Desktop class and it's open method.
- 10-07-2008, 01:50 PM #4
It is dependant on the OS and on how a user has tailored his system. I'm on XP and I've set Wordpad to open when I click on a .txt file.
In windows there is an OS command that will lookup the default command to use when opening a file. However I think its different on different versions of windows. For some it's CMD and for others its COMMAND.
- 10-08-2008, 08:58 AM #5
I thought it was "COMMND" but that was long ago.
Its been CMD in Windows 32 bit always. From NT 3.1 on.
If you are still running Win16 (windows 95, Win98, WindowsME) then its still COMMAND (or COMMND) but no one should be using those things. They are from last century.
Back on topic, the reason that java 1.6 has the Desktop stuff is that without it, you can't do it transparently without all sorts of OS specific voodoo
- 10-08-2008, 06:17 PM #6
Where does Java find the "user-default' programs?
I just tried the DesktopDemo program from the Java Tutorial and find that it does NOT use my defauts. I've tailored my system changing MS's defaults to what I like. For example, DC on a .html file starts Firefox. DC on a .txt file starts Wordpad.
In the DesktopDemo program, it started IE for a .html file and Notepad for a .txt file. Those are NOT my defaults.
Where does the JVM look to find the "user-default" programs? I would assume on Windows it'd look in the registry. It obviously doesn't use the same path as a user can to set the defaults: Tools|Folder Options|File Types|Registered Filetypes ...
Thanks,
Norm
Similar Threads
-
Default/System Date Format Pattern?
By Gajesh Tripathi in forum AWT / SwingReplies: 1Last Post: 10-05-2008, 07:34 AM -
opening jar files on pc prepared by mac
By willemjav in forum Advanced JavaReplies: 42Last Post: 09-27-2008, 05:53 PM -
Invoking the system text editor on autoexec.bat
By Java Tip in forum SWTReplies: 0Last Post: 07-25-2008, 02:32 PM -
SWT Text Editor
By Java Tip in forum SWTReplies: 0Last Post: 07-07-2008, 04:43 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks