I have this Runnable window:
EventQueue.invokeLater(new Runnable(){
@Override
public void run() {
op = new JOptionPane("Breaktime",JOptionPane.WARNING_MESSAGE);
dialog = op.createDialog("Break");
dialog.setAlwaysOnTop(true);
dialog.setModal(true);
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
}
});
Is it possible that I can have a timer here to close this within 1 or 2 minutes instead of clicking the OK button?