Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating a Temporary File  RSS feed

 
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
 
Bartender
Posts: 11445
18
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
Bartender
Posts: 11445
18
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
Bartender
Posts: 11445
18
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
Bartender
Posts: 11445
18
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
Bartender
Posts: 11445
18
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
Boost this thread!