From 79af461a5ba57444ec9ecf0b77e82a92a39402dc Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Tue, 24 Aug 2021 15:38:15 +0200 Subject: [PATCH] Theme Editor: instead of creating empty `FlatLightLaf.properties` and `FlatDarkLaf.properties`, add some how-to-use description to those files --- .../flatlaf/themeeditor/FlatThemeFileEditor.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java index 0790ab04..a05c49e9 100644 --- a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java @@ -187,8 +187,15 @@ public class FlatThemeFileEditor return newPropertiesFile( dir ); else if( result == 1 ) { try { - new File( dir, "FlatLightLaf.properties" ).createNewFile(); - new File( dir, "FlatDarkLaf.properties" ).createNewFile(); + String content = + "# To use this in your application, make sure that this properties file\n" + + "# is included in your application JAR (e.g. in package `com.myapp.themes`)\n" + + "# and invoke `FlatLaf.registerCustomDefaultsSource( \"com.myapp.themes\" );`\n" + + "# before setting the look and feel.\n" + + "# https://www.formdev.com/flatlaf/how-to-customize/#application_properties\n" + + "\n"; + writeFile( new File( dir, "FlatLightLaf.properties" ), content ); + writeFile( new File( dir, "FlatDarkLaf.properties" ), content ); return true; } catch( IOException ex ) { ex.printStackTrace();