title: Spring Boot use SystemTray Icons
body: <p>I am setting up a Spring Boot Application and would like to have the host have access to a System Tray Icon with access to some bean Information.</p>
  
  <p>I currently Tried to Create a Bean for my SystemTrayIcon with the @Autowired details. However When I try to add the SystemTrayIcon I get the following Exception:</p>
  
  <pre><code>Caused by: java.awt.HeadlessException
      at java.awt.TrayIcon.&lt;init&gt;(Unknown Source)
      at java.awt.TrayIcon.&lt;init&gt;(Unknown Source)
      at java.awt.TrayIcon.&lt;init&gt;(Unknown Source)
      at hermes.subsrciber.systemTray.HermesTrayIcon.&lt;init&gt;(HermesTrayIcon.java:36)
      at hermes.subscriber.boot.AppStarter.trayIcon(AppStarter.java:83)
      at hermes.subscriber.boot.AppStarter$$EnhancerBySpringCGLIB$$c4f80849.CGLIB$trayIcon$3(&lt;generated&gt;)
      at hermes.subscriber.boot.AppStarter$$EnhancerBySpringCGLIB$$c4f80849$$FastClassBySpringCGLIB$$d62ab0bd.invoke(&lt;generated&gt;)
      at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
      at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312)
      at hermes.subscriber.boot.AppStarter$$EnhancerBySpringCGLIB$$c4f80849.trayIcon(&lt;generated&gt;)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166)
      ... 17 more
  </code></pre>
  
  <p>Is there any way that a SpringBoot Application can have access to System Tray Icons?</p>
  
  <p>I believe I CAN simply define it in the Main method (alongisde the SpringApplication.run) however I would not be able to autowire my properties. </p>
  
  <p>Is this setup possible?</p>