title: How to get Java's TrayIcon message to fade out?
body: <p>I have a Java application that reduce into the system tray when the red cross is pressed.</p>
  
  <p>Whenever this happen, I display a message to inform the user that the application is still running in the system tray.</p>
  
  <p>Here's the code for that :</p>
  
  <pre><code>...
  
      @Override
      public void windowClosing(WindowEvent e) {
         try {
              tray.add(trayIcon);
              trayIcon.displayMessage("", "The application has been reduced
                   in the system tray, to stop it, press the \"Quit\" button", 
                   TrayIcon.MessageType.WARNING);
              setVisible(false);
          } catch (AWTException ex) {
              System.out.println("unable to add to tray");
          }
      }
  ...
  </code></pre>
  
  <p>For the moment, the message disappears if the user clicks on it.</p>
  
  <p>I would like to set up a counter so the message would fade out after a couple of seconds even if nothing has been done.</p>
  
  <p>Does anyone know a nice way to do it cause I can't seem to find any existing method for that.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have to correct my question, in fact, after testing it a little bit longer, it automatically fades out after, let's say, 7-8 seconds but I find it a little bit too long. Also, it only disappears if the user is executing an action (moving the mouse or typing on the keyboard)</p>
  
  <p>So the new question would be : Is there a way to reduce the fade out time and change the message behaviour by configuring the Java application or is it inherent to Windows?</p>