Skip to content

A simple tool to use a Tray Launcher for Spring Boot Applications

License

Notifications You must be signed in to change notification settings

dfuchss/tray-launcher-4-spring-boot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tray-launcher-4-spring-boot

Maven Deploy Latest Release Quality Gate Status GitHub license

A simple tool to use a Tray Launcher for Spring Boot Applications

HowTo

  • Add the tray launcher dependency to maven ..
<dependencies>
    <dependency>
        <groupId>org.fuchss</groupId>
        <artifactId>tray-launcher-4-spring-boot</artifactId>
        <version>X.Y.Z</version>
    </dependency>
</dependencies>
  • Create a simple configuration that contains at least the name, default url, and icon of your project:
SpringBootTrayLauncherConfiguration conf = new SpringBootTrayLauncherConfiguration(
  "Name", 
  "http://localhost:8080", 
  Main.class.getResourceAsStream("/icon.jpg")
);
  • Modify your main class:
@SpringBootApplication
@EnableAutoConfiguration
public class Main {
	public static void main(final String[] args) {
		// Replace SpringApplication.run(Main.class, args) by this ..
		SpringBootTrayLauncherConfiguration conf = new SpringBootTrayLauncherConfiguration("Name", "http://localhost:8080", Main.class.getResourceAsStream("/icon.jpg"));
		// You may add additional Urls for the launcher
		conf.setAdditionalUrls(List.of(new URLEntry("Login", "http://localhost:8080/login")));
		SpringBootTrayLauncher.run(Main.class, args, conf);
	}
}
  • Now you can start your application and use a simple tray icon :)

tray-example