Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.awt.MouseInfo;
- String date;
- String time;
- PrintWriter output = null;a
- int x;
- int y;
- int val =2;
- void draw() {
- x = MouseInfo.getPointerInfo().getLocation().x;
- y = MouseInfo.getPointerInfo().getLocation().y;
- if(MouseInfo.getPointerInfo().getLocation().x != 0 || MouseInfo.getPointerInfo().getLocation().y != 0) val =1;
- if (val ==1){
- date = nf(month(),2) + "/" + nf(day(),2) + "/" +year() ;
- time = nf(hour(),2) + ":" + nf(minute(),2) + ":" + nf(second(),2);
- println("found something");
- try
- {
- output = new PrintWriter(new BufferedWriter(new FileWriter("today.txt", true)));
- output.println(date + "," + time);
- }
- catch (IOException e)
- {
- println("haha you have an error");
- }
- finally
- {
- if (output != null)
- {
- output.close();
- }
- }
- delay()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement