title: Updating message in JOptionPane
body: <p>I am trying to make a digital clock which displays the time in a JOptionPane. I've managed to display the time on the message dialog box. However, I can't figure out how to make it update the time at every second in the dialog box. </p>
  
  <p>This is what I currently have:</p>
  
  <pre><code>    Date now = Calendar.getInstance().getTime();
      DateFormat time = new SimpleDateFormat("hh:mm:ss a.");
  
      String s = time.format(now);
  
      JLabel label = new JLabel(s, JLabel.CENTER);
      label.setFont(new Font("DigifaceWide Regular", Font.PLAIN, 20));
  
      Toolkit.getDefaultToolkit().beep();
  
      int choice = JOptionPane.showConfirmDialog(null, label, "Alarm Clock", JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE);
  </code></pre>