Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gingaabread/jtoasti
JToasti is a super simple Java library that allows the quick and beautiful implementation of toasts in JavaFX
https://github.com/gingaabread/jtoasti
gui java javafx javafx-gui ui ui-components
Last synced: 2 months ago
JSON representation
JToasti is a super simple Java library that allows the quick and beautiful implementation of toasts in JavaFX
- Host: GitHub
- URL: https://github.com/gingaabread/jtoasti
- Owner: GingaaBread
- License: apache-2.0
- Created: 2020-11-03T18:49:50.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-10T14:34:03.000Z (about 4 years ago)
- Last Synced: 2024-10-12T18:41:03.343Z (3 months ago)
- Topics: gui, java, javafx, javafx-gui, ui, ui-components
- Language: Java
- Homepage:
- Size: 666 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JToasti
JToasti is a super simple Java library that allows the quick and beautiful implementation of toasts in JavaFX### The Toast Types
![](Github/InformationToast.png)
![](Github/SuccessToast.png)
![](Github/WarningToast.png)
![](Github/UndoToast.png)**Example**:
![](Github/JToasti.gif)
Naturally, the titles, descriptions, and icons can be customised.
## Download & Installation:
Just add the jar to your project build path to use JToastiVersion 3.0:
www.shorturl.at/koKY7You can also find older versions in the Releases section. Please note that these are not recommended as they are outdated.
## How to use:
Create an object of the JToasti class and add it to a container. To spawn a toast simply use the spawnToast() method. ToastType describes the type of toast that will be displayed: Available types are information, warning, and success. These only differ in appearance. There is also the undo toast type that contains an undo button. You can add an event listener by using the setOnUndo() method. Finally, provide a title and description for your toast and that's all!Simple Example:
```java
// Creates the toast container
JToasti toastContainer = new JToasti();
// You can use a simple lamda expression to add an event
toastContainer.setOnUndo( e -> System.out.println("Undid the last action"));// Spawns an undo toast
anyButton.setOnAction(e -> toastContainer.spawnToast(ToastType.UNDO, "Deletion", "Successfully deleted the file"));
// Adds the toast container to a pane
anyPane.getChildren().add(toastContainer);
```## Adjustments:
Of course you can change the toast icons as well as title and description fonts. You can also adjust the toast lifetime, the fadeout speed, its preferred height, and its preferred width. In order to do so simply use the respective setter methods. As the JToasti class extends JavaFX's VBox, you can obviously use all VBox methods (like spacing) as well.
## License:
Please see the LICENSE file