Theme Editor: instead of creating empty FlatLightLaf.properties and FlatDarkLaf.properties, add some how-to-use description to those files

This commit is contained in:
Karl Tauber
2021-08-24 15:38:15 +02:00
parent 2e8e07faf6
commit 79af461a5b

View File

@@ -187,8 +187,15 @@ public class FlatThemeFileEditor
return newPropertiesFile( dir ); return newPropertiesFile( dir );
else if( result == 1 ) { else if( result == 1 ) {
try { try {
new File( dir, "FlatLightLaf.properties" ).createNewFile(); String content =
new File( dir, "FlatDarkLaf.properties" ).createNewFile(); "# 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; return true;
} catch( IOException ex ) { } catch( IOException ex ) {
ex.printStackTrace(); ex.printStackTrace();