diff --git a/src/main/java/com/chromascape/web/ChromaScapeApplication.java b/src/main/java/com/chromascape/web/ChromaScapeApplication.java index 31aed28..faeb1c0 100644 --- a/src/main/java/com/chromascape/web/ChromaScapeApplication.java +++ b/src/main/java/com/chromascape/web/ChromaScapeApplication.java @@ -27,6 +27,8 @@ public class ChromaScapeApplication { * @param args command-line arguments passed to the application */ public static void main(String[] args) { + // Disable headless mode to allow GUI components (e.g., MouseOverlay) + System.setProperty("java.awt.headless", "false"); SpringApplication.run(ChromaScapeApplication.class, args); } diff --git a/src/main/java/com/chromascape/web/ServePages.java b/src/main/java/com/chromascape/web/ServePages.java index fedb666..0765bc5 100644 --- a/src/main/java/com/chromascape/web/ServePages.java +++ b/src/main/java/com/chromascape/web/ServePages.java @@ -12,26 +12,22 @@ public class ServePages { /** - * Handles GET requests for the root ("/") URL. Sets the AWT system property to non-headless mode, - * then returns the view name for the index page. + * Handles GET requests for the root ("/") URL. * * @return the logical view name "index" */ @GetMapping("/") public String serveIndexPage() { - System.setProperty("java.awt.headless", "false"); return "index"; } /** - * Handles GET requests for the "/colour" URL. Sets the AWT system property to non-headless mode, - * then returns the view name for the colour picker page. + * Handles GET requests for the "/colour" URL. * * @return the logical view name "colour" */ @GetMapping("/colour") public String serveColourPickerPage() { - System.setProperty("java.awt.headless", "false"); return "colour"; } }