Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Post Java execution, opening completed file on Windows

 
Sean Davidson
Greenhorn
Posts: 6
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this program where I take in an excel file and manipulate it, I currently have it saving to a specific folder. Is there anyway I can have that file open on the user's computer after the program has executed.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are we talking about a HTTP server / client browser architecture here?

Bill
 
Sean Davidson
Greenhorn
Posts: 6
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No I have this little Applet / Application for my company, it simply takes in an excel file, highlights specific cells. Then saves the new file.

I want my program to open that file on the user's computer once it is saved.

EDIT: So the user doesn't have to go in and open the file him/herself.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By "Open that file" you mean "Launch Excel with that document opened", yes?

You would use Runtime.exec() to run a command like "cmd.exe /c start foo.xls" . The classic article on Runtime.exec() -- which you absolutely should read! -- is here. It will tell you exactly what to do, and what not to do.
 
Rob Spoor
Sheriff
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or use java.awt.Desktop's open method.
 
Sean Davidson
Greenhorn
Posts: 6
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much, I'll try it in a minute.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic