Swing Themes Library
Tutorial
Section titled “Tutorial”- Import SwingThemesLibrary in your project as a dependency (see Releases for .jar file)
Themes
Section titled “Themes”-
Create a theme
Theme theme = new Theme(); //And insert each color by hand//orTheme theme_json = new Theme(new JsonString(your_json_string);//orTheme theme_yaml = new Theme(new YamlFile(full_file_directory]); -
Parse Yaml file
Theme theme = new Theme();theme.parseYaml(new YamlFile(full_file_directory); -
Parse Json
Theme theme = new Theme();theme.parseJson(new JsonString(your_json_string); -
Generate Yaml from Theme
YamlFile yaml = existing_theme.generateYaml(target_directory); //Creates .yml file in [targer directory] -
Generate Json from Theme
JsonString json = existing_theme.generateJson();
ThemeCollection
Section titled “ThemeCollection”-
Create a ThemeCollection
ThemeCollection themes = new ThemeCollection(); // No other constructor exists -
Add a theme
themes.add(new Theme()); -
Load themes
themes.load(new File(folder_path)); // Folder containing .yml files with wanted themes//orthemes.load(new String[]{[strings with theme information]}); -
Apply Theme on a container
JFrame frame = new JFrame();Theme theme = new Theme(); //non empty themeThemeCollection.applyTheme(frame, theme);
Set your JComponent’s name following the notation of the sample_theme.yml. This will determine the color of each component.
Dependencies
Section titled “Dependencies”<dependency> <groupId>kdesp73.themeLib</groupId> <artifactId>SwingThemesLibrary</artifactId> <version>1.0.1-SNAPSHOT</version></dependency>git clone https://github.com/KDesp73/Swing-Themes-Library- Make dependency fully public on the Maven repository