Skip to content

Latest commit

 

History

History
92 lines (78 loc) · 2.59 KB

README.md

File metadata and controls

92 lines (78 loc) · 2.59 KB

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

  • Copy jar library file to the root project. exp : library/swing-glasspane-popup-1.5.0.jar
  • Add this code to pom.xml
<dependency>
    <groupId>raven.popup</groupId>
    <artifactId>swing-glasspane-popup</artifactId>
    <version>1.5.0</version>
    <scope>system</scope>
    <systemPath>${basedir}/library/swing-glasspane-popup-1.5.0.jar</systemPath>
</dependency>
  • Other library are use with this library
<dependency>
  <groupId>com.formdev</groupId>
  <artifactId>flatlaf</artifactId>
  <version>3.4</version>
</dependency>

<dependency>
  <groupId>com.formdev</groupId>
  <artifactId>flatlaf-extras</artifactId>
  <version>3.4</version>
</dependency>

<dependency>
    <groupId>com.miglayout</groupId>
    <artifactId>miglayout-swing</artifactId>
    <version>11.3</version>
</dependency>

libraries

  • FlatLaf - FlatLaf library for the modern UI design theme
  • MigLayout - MigLayout library for flexible layout management

Sample Code

//  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();