#Description 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.
Yes, you understand, this theme in addition to changing the look and fell also supports Android components (those possible to implement)
What does it support?
It supports the Toast component of android and here it is called MaterialToast you can find the documentation here and in the demo an example is included.
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);
//Using MaterialToast
JButton buttonTwoo = new JButton();
class ActionToastTest extends AbstractAction{
JComponent component;
public ActionToastTest(JComponent component){
this.component = component;
putValue(Action.NAME, "Test Toast");
putValue(Action.SHORT_DESCRIPTION, "Test Toast");
}
@Override
public void actionPerformed(ActionEvent e) {
MaterialTost.makeText(frame, "This is a message in a toast component", MaterialTost.NORMAL).display();
}
}
buttonTwoo.setAction(new ActionToastTest(pn));
// on hover, button will change to a light gray
MaterialUIMovement.add (button, MaterialColors.GRAY_100);
frame.pack ();
frame.setVisible (true);
}
}
Check src/MaterialUISwingDemo.java
for a slightly longer example of how to use this library (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 😀