A modern, Material Design UI for Java Swing
Skins JComponents to have a Material Design Look and Feel. Most components are responsive, with hover effects, and click effects (no ripple unfortunately). Fonts included.
Screenshot in action below (chessboard not included 😛):
Go to the releases (or just the target/classes
folder in the repo) and download the latest version of material-ui-swing.jar
. The OSGi version is available under target
. Add it to your project's build path (e.g. for IntelliJ this might help), and you're all set!
import mdlaf.*;
import mdlaf.animation.*;
import javax.swing.*;
import java.awt.*;
public class MaterialUISwingDemo {
public static void main (String[] args) {
try {
UIManager.setLookAndFeel (new MaterialLookAndFeel ());
}
catch (UnsupportedLookAndFeelException e) {
e.printStackTrace ();
}
JFrame frame = new JFrame ("Material Design UI for Swing by atharva washimkar");
frame.setMinimumSize (new Dimension (600, 400));
JButton button = new JButton ("PRESS ME");
button.setMaximumSize (new Dimension (200, 200));
JPanel content = new JPanel ();
content.add (button);
frame.add (content, BorderLayout.CENTER);
// on hover, button will change to a light gray
MaterialUIMovement.add (button, MaterialColors.GRAY_100);
frame.pack ();
frame.setVisible (true);
}
}
Check src/main/java/MaterialUISwingDemo.java
for a slightly longer example of how to use this library (and an explanation of what everything means/does).
For a real-world example of usage, see here.
If there's a component that isn't supported, don't hesitate to open an issue! I can usually code something up for you in a couple of days 😀