Open Document Handling in Java

Discussion in 'Mac Programming' started by stadidas, May 27, 2006.

  1. macrumors regular

    Joined:
    Feb 27, 2006
    Location:
    Kent, United Kingdom
    #1
    I currently have an application which generates files with a .amd file extension. I would like when these files are double clicked to launch the application and have the path of the file passed to the app. Currently when a file is clicked the application launches, but just the main screen appears.
    At the beginning of the main class is t his code:
    Code:
    fApplication.addApplicationListener(new com.apple.eawt.ApplicationAdapter() {
    			public void handleAbout(ApplicationEvent e) {
                                    if (aboutBox == null) {
                                        aboutBox = new AboutBox();
                                    }
                                    about(e);
                                    e.setHandled(true);
    			}
    			public void handleOpenApplication(ApplicationEvent e) {
    			}
    			public void handleOpenFile(ApplicationEvent e) {
    			}
    			public void handleQuit(ApplicationEvent e) {
    				quit(e);
    			}
    		});
    
    I know I need something in the handleOpenFile listener, but don't know what code to use.

    If anyone has any suggestions I would be very grateful to hear them.
     
  2. thread starter macrumors regular

    Joined:
    Feb 27, 2006
    Location:
    Kent, United Kingdom
    #2
    No-one has any ideas?
     

Share This Page