Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating a Temporary File

 
Pranay Narotam
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I would like to create a temporary text file,and it should open up when the text file is created.

here is my code to create a temp file

Please tell me if this is correct

And can you please show me how to automatically open the temp file when it is created

Thanks

Pranay
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pranay Narotam wrote:
Please tell me if this is correct


Did you run your code? Did the file get created with those contents?
 
Pranay Narotam
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

Yes i did run the code, and the file is created with the contents.

But it does not open up when it is created

Thanks

Pranay
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you trying to open it?
 
Pranay Narotam
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well it opens up when i run it from any explorer, but I want it to open up from runtime,

Thanks

Pranay
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out Desktop#open(File file) if you are using 1.6+
 
Pranay Narotam
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I'm running 1.5

Thanks

Pranay
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok.
Search the forums. This question comes up quite many times. The answer has already been posted there.
 
Pranay Narotam
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me explain to you exactly what I want

I have a button, when a user presses that button, a temporary
text file should be created and should appear, and when the
user closes that file, than that file should be deleted.
I got the temp file to be created, but i need it to appear when it
is created.

Thanks

Pranay
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got what you wanted the first time. Thanks.
Like I said search the forums on how to programatically open a file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic