Constructor
Creates a new toast notification.
Enums
Type
Defines the toast notification type:DEFAULT- Default toast styleSUCCESS- Success message (green)DANGER- Error message (red)WARNING- Warning message (yellow/orange)INFO- Information message (blue)
Position
Defines where the toast appears:TOP_RIGHT- Top right cornerTOP_LEFT- Top left cornerBOTTOM_RIGHT- Bottom right cornerBOTTOM_LEFT- Bottom left cornerTOP_CENTER- Top centerBOTTOM_CENTER- Bottom center
Methods
show(Window owner, String title, String message, Type type, Position position, Duration duration)
void
Displays the toast notification.
Shows a toast with previously configured pending values.
Static Helper Methods
Quick static method to show a toast without title.
JToast.show(Window owner, String title, String message, Type type, Position pos, int durationMillis)
void
Quick static method to show a toast with title.
Factory method for creating a toast with chaining support.
A configured JToast instance ready to show
Usage Examples
Static Quick Usage
Instance Usage
Factory Method with Chaining
Persistent Toast
Features
- Auto-close with configurable duration
- Manual close button (X)
- Multiple position options
- Type-based styling (success, danger, warning, info)
- Optional title
- Smooth fade-in animation
- Non-blocking overlay
Style Classes
.j-toast- Main container.j-toast-success- Success variant.j-toast-danger- Danger variant.j-toast-warning- Warning variant.j-toast-info- Info variant.j-toast-title- Title label.j-toast-message- Message label.j-toast-close- Close button