Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

screen capture scheduler

 
bhavit pant
Greenhorn
Posts: 21
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


1->this code works perfactly fine. i triedto make A little modification , i want image to to be saved in a folder specified by date, but this is not working, i tried to create a dir, but dont know how to save it in a that dir(in every 10 mins).
please help.
 
Paul Clapham
Sheriff
Posts: 21126
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't write a file into a directory which doesn't exist. You'll have to create the directory first.

Hint: the java.io.File class has a method which you can use to create a directory.
 
bhavit pant
Greenhorn
Posts: 21
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

thanks for the reply sir, even after creating a dir, and trying to write onto that, , this ain't working...
used this constructor
public File(String parent,
String child).. form IO api..
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read https://www.coderanch.com/how-to/java/ItDoesntWorkIsUseless. What is or is not happening if you run the code? What is the return value of the mkdir call and the ImageIO.write call?
 
bhavit pant
Greenhorn
Posts: 21
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry for the sub standard post,
-> what is happning is a file named as currrent date is created , and mkdir() call is returning false(i wonder why??).
 
bhavit pant
Greenhorn
Posts: 21
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
file not found exception, null pointer exception
 
bhavit pant
Greenhorn
Posts: 21
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
done txx..gurus for your help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic