Anyone had any success with <Desktop>.open() in 1.6?



I've been playing around with the new Desktop class in 1.6. I've
gotten the mail() and browse() methods to work as advertised, but
not the open() method. Example code:

import java.awt.Desktop;
import java.io.*;

public class DesktopTest
{
public static void main ( String[] args )
{
System.out.println( "Desktop supported?: " +
Desktop.isDesktopSupported() );
Desktop desk = Desktop.getDesktop();

try
{
File file = new File( "d:\\basic.txt" );
System.out.println( "File exists?: " + file.exists() );
desk.open( file );
}
catch( IOException exc )
{
System.out.println( exc.getMessage() );
}
}
}

Both println's display "true", but I get no window, no exception,
no nuttin'. Also tried the edit() method with same results. Text
files are associated with Notepad on my system. If I double-click
basic.txt in Windows Explorer, Notepad opens.

Lee Weiner
lee AT leeweiner DOT org
.



Relevant Pages

  • Re: Desktop.ini [Notepad] opens at boot and stays open
    ... When you logon to Windows XP, Notepad opens one or more documents containing ... Disabled the built-in Administrator account. ...
    (microsoft.public.windowsxp.newusers)
  • Re: Why does WORD always save documents as Word Notepad?
    ... click on a file name in Explorer, Notepad opens. ... all .jpg files will open in this program. ...
    (microsoft.public.word.docmanagement)
  • Re: Cannot open a .php file
    ... I can't open a .php file using using Windows 98. ... Notepad opens and I type in the following: ... If not Open Windows Explorer ...
    (alt.php)
  • Need help!
    ... Notepad opens only text documents. ... If MyMoney is a ... folder, you only need to double-click on it to open it. ...
    (microsoft.public.security)