I wrote a simple Java program to open a specific webpage when the program is run. I need to close it again after a given amount of time. Here is the function I wrote and am using to open the page:
public static void openWebpage(String uri) throws Exception {
java.awt.Desktop.getDesktop().browse(new java.net.URI(uri));
}
Is there a way to close that webpage programatically? I already have another thread acting as a timer, so I simply need to close the webpage once the timer runs out.