I want to create a wait period between code like this:
javax.swing.JOptionPane.showMessgeDialog(null, "2 hours left");
// Wait for 2 hours
javax.swing.JOptionPane.showMessageDialog(null, "2 hours ago");  
But i don't know how to make this wait period, i will try all answers and chose the best one but please answer me.
 
     
     
     
    