Java Swing UI popup dialog custom using glasspane with flatlaf include the animation style, and drawer menu
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>
- FlatLaf - FlatLaf library for the modern UI design theme
- MigLayout - MigLayout library for flexible layout management
// 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
}
}
}));
GlassPanePopup.push(childComponent, "popupname");
GlassPanePopup.pop("popupname");
public SimplePopupBorder(Component component,
String title,
SimplePopupBorderOption option,
String[] action,
PopupCallbackAction callbackAction);
new SimplePopupBorderOption()
.setRoundBorder(30)
.setWidth(500)
.useScroll();