Skip to content

Latest commit

 

History

History
145 lines (99 loc) · 5.48 KB

README.md

File metadata and controls

145 lines (99 loc) · 5.48 KB

Material-UI-Swing

Maven Central GitHub All Releases

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 😛):

Screenshot

Screenshot

Other screenshot you can found here

Usage

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!

Example

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.

Version 1.0.0

This look and feel implements theming to change the color scheme of the Material UI. Currently this isn't completely stable, but if you want to implement a theme for this look and feel, you can extend and implement the abstract class AbstractMaterialTheme (look at mdlaf.themes.MaterialLiteTheme for an example).

To change the theme, use the below code:

 if (UIManager.getLookAndFeel() instanceof MaterialLookAndFeel){
     MaterialLookAndFeel.changeTheme(new MaterialDarkTheme());
 }

A working example is also found here.

This theming system was implemented by @vincenzopalazzo

Stack Overflow

We don't have much time to write detailed documentation, but if you want to get help, post a question on Stack Overflow with the tags material-ui-swing, java, material, swing, look-and-feel.

Repository

Maven

<dependency>
 <groupId>io.github.vincenzopalazzo</groupId>
 <artifactId>material-ui-swing</artifactId>
 <version>1.1.1_pre-release_6.1</version>
</dependency>

Gradle

implementation 'io.github.vincenzopalazzo:material-ui-swing:1.1.1_pre-release_6.1'

Others version here

License

License

List of projects with Material-UI-Swing theme

Contact us if you use this look and feel so we can add your project to the list 🙂

Community

Gitter chat

Sponsors

Support this project

Donation Custom badge

Donors

Screenshot

MaterialLiteTheme

MaterialOceanicTheme

JMarsDarkTheme

Other screenshot you can found here

Java doc

You can consult the javadoc at this link

Dev

This is the official repository of material-ui-swing but the developing of a new feature we do in this in this repository vincenzopalazzo/material-ui-swing and after testing the official release will release in this branch.