Skip to content

DJ-Raven/glasspane-popup

Repository files navigation

Glasspane-popup

Custom glasspane popup like jdialog using java swing. to make your desktop app look more beautiful. This custom with animation library and miglayout.

Sample Code

GlassPanePopup.install(jfram);

How to popup component

JPanel panel = new JPanel();
panel.setPreferredSize(new Dimension(300, 300));
GlassPanePopup.showPopup(panel);

Popup with name and option

Option option = new DefaultOption() {
    @Override
    public float opacity() {
        return 0.3f;
    }

    @Override
    public boolean closeWhenClickOutside() {
        return true;
    }

    @Override
    public Color background() {
        return Color.ORANGE;
    }

};
GlassPanePopup.showPopup(panel, option, "ms1");

How to close popup

//  Close last popup
GlassPanePopup.closePopupLast();

//  Close by name
GlassPanePopup.closePopup("ms1");

//  Close by index
GlassPanePopup.closePopup(0);

//  Close all popup
GlassPanePopup.closePopupAll();

Screenshot

2023-01-05_225048