PDA

View Full Version : Open Document Handling in Java




stadidas
May 27, 2006, 09:33 AM
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:

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.



stadidas
May 28, 2006, 08:12 AM
No-one has any ideas?