I'm writing a Java program which checks some statistics of my Web site. The program should point out an alert if there are some issues with the site. Since I'm working with a Windows Vista machine I thought the simplest thing would be to create a Task from Windows Scheduler which fires every n minutes.
Strangely enough, the Task Scheduler is not able to display Java GUI. The program just stops (either running with java or javaw) and does not display anything.
Here's a minimal example:
import javax.swing.JOptionPane;
public class Test {
public static void main(String[] args) {
try {
JOptionPane.showMessageDialog(null, "Message text", "Title", JOptionPane.ERROR_MESSAGE);
System.out.println("Done");
} catch (IOException e) {
e.printStackTrace();
}
}
}
I've tried also with some other Swing components but it just does not display anything. Seems it's missing the graphical interface. Any clue ? Thanks Max