DJ-Raven / swing-glasspane-popup

Java swing UI popup dialog custom using glasspane
MIT License
25 stars 8 forks source link
java-swing popup-dialog ui

Swing Glasspane Popup

Java Swing UI popup dialog custom using glasspane with flatlaf include the animation style, and drawer menu

sample dark 

sample light

Installation

This project library do not available in maven central. so you can install with the jar library

com.formdev flatlaf-extras 3.4 com.miglayout miglayout-swing 11.3

## libraries
- [FlatLaf](https://github.com/JFormDesigner/FlatLaf) - FlatLaf library for the modern UI design theme
- [MigLayout](https://github.com/mikaelgrev/miglayout) - MigLayout library for flexible layout management

## Sample Code

``` java
//  Install with jframe

GlassPanePopup.install(jframe);

//  Show glasspane popup

String action[] = {"Cancel", "OK"};
GlassPanePopup.showPopup(new SimplePopupBorder(
    component,
    "Sample Message",
    action,
    new PopupCallbackAction() {
        @Override
        public void action(PopupController controller, int action) {
            if (action == 0) {
                //  action cancel
            } else if (action == 1) {
                //  action ok
            }
        }
}));

Push and Pop with name

GlassPanePopup.push(childComponent, "popupname");

GlassPanePopup.pop("popupname");

SimplePopupBorder

public SimplePopupBorder(Component component,
                         String title,
                         SimplePopupBorderOption option,
                         String[] action,
                         PopupCallbackAction callbackAction);
new SimplePopupBorderOption()
                    .setRoundBorder(30)
                    .setWidth(500)
                    .useScroll();