Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kdesp73/swing-themes-library
Java Swing Themes Library
https://github.com/kdesp73/swing-themes-library
java swing swing-components themes
Last synced: 2 months ago
JSON representation
Java Swing Themes Library
- Host: GitHub
- URL: https://github.com/kdesp73/swing-themes-library
- Owner: KDesp73
- License: mit
- Created: 2023-02-06T14:36:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-27T20:25:11.000Z (about 1 year ago)
- Last Synced: 2023-11-28T19:47:21.150Z (about 1 year ago)
- Topics: java, swing, swing-components, themes
- Language: Java
- Homepage:
- Size: 771 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Swing Themes Library
## Tutorial
* Import SwingThemesLibrary in your project as a dependency (see [Releases](https://github.com/KDesp73/Swing-Themes-Library/releases) for .jar file)
### Themes
* Create a theme
```java
Theme theme = new Theme(); //And insert each color by hand//or
Theme theme_json = new Theme(new JsonString(your_json_string);
//or
Theme theme_yaml = new Theme(new YamlFile(full_file_directory]);
```* Parse Yaml file
```java
Theme theme = new Theme();
theme.parseYaml(new YamlFile(full_file_directory);
```* Parse Json
```java
Theme theme = new Theme();
theme.parseJson(new JsonString(your_json_string);
```
* Generate Yaml from Theme
```java
YamlFile yaml = existing_theme.generateYaml(target_directory); //Creates .yml file in [target directory]
```
* Generate Json from Theme
```java
JsonString json = existing_theme.generateJson();
```
### ThemeCollection* Create a ThemeCollection
```java
ThemeCollection themes = new ThemeCollection(); // No other constructor exists
```
* Add a theme
```java
themes.add(new Theme());
```
* Load themes
```java
themes.load(new File(folder_path)); // Folder containing .yml files with wanted themes
//or
themes.load(new String[]{[strings with theme information]});
```
* Apply Theme on a container
```java
JFrame frame = new JFrame();
Theme theme = new Theme(); //non empty theme
ThemeCollection.applyTheme(frame, theme);
```> Set your JComponent's name following the notation of the [sample_theme.yml](https://github.com/KDesp73/Swing-Themes-Library/blob/main/Samples/sample_theme.yml). This will determine the color of each component.
## Dependencies
```xml
kdesp73.themeLib
SwingThemesLibrary
1.0.1-SNAPSHOT```
## Clone
```bash
git clone https://github.com/KDesp73/Swing-Themes-Library
```## TODO
* Make dependency fully public on the Maven repository## Contributing
Contributions are always welcome!
See [Contributing.md](https://github.com/KDesp73/Swing-Themes-Library/blob/main/CONTRIBUTING.md) for ways to get started.
Please adhere to this project's [Code of Conduct](https://github.com/KDesp73/Swing-Themes-Library/blob/main/CODE_OF_CONDUCT.md).
## Authors
- [@KDesp73](https://github.com/KDesp73)
## License
[MIT](https://choosealicense.com/licenses/mit/)