I am creating a small application to take a screenshot. I can save it automatically on my desktop using this path:
String FILENAME = "C:\\Users\\obed\\Desktop\\" + x + ".png"; ImageIO.write(image, "png", new File(FILENAME));
where Obed is my username. How can I automatically change βobedβ to a username so that I can run my application on any computer this way?
source share