A modern, Material Design UI for Java Swing
One month late, we are happy to announce version 1.1.2 that close the our big Milestone Material-UI-Swing 1.1.2.
This version includes the following changes
Ask question about the release, join to the discussion at the following link https://github.com/vincenzopalazzo/material-ui-swing/discussions/166
See also here
See also here
P.S: Sorry if we break your App with the new theme but these are really cool 💯 .
Join in the new Github discussion to give us feedback and ideas
<dependency>
<groupId>io.github.vincenzopalazzo</groupId>
<artifactId>material-ui-swing</artifactId>
<version>1.1.2</version>
</dependency>
Groovy
implementation 'io.github.vincenzopalazzo:material-ui-swing:1.1.2'
Kotlin
implementation("io.github.vincenzopalazzo:material-ui-swing:1.1.2")
io.github.vincenzopalazzo.materialuiswing
If you like the library and want to support it, please considerer to donate with the following system
This release is a hotfix to fix the casting bug described below:
<dependency>
<groupId>io.github.vincenzopalazzo</groupId>
<artifactId>material-ui-swing</artifactId>
<version>1.1.2-rc1</version>
</dependency>
Groovy
implementation 'io.github.vincenzopalazzo:material-ui-swing:1.1.2-rc1'
Kotlin
implementation("io.github.vincenzopalazzo:material-ui-swing:1.1.2-rc1")
io.github.vincenzopalazzo.materialuiswing
If you like the library and want support it, please considerer to donate with the following system
I am happy to annunce the Material-UI-Swing library 1.1.1, after a very long incubation period, around 9 months. This version of the library imported a complete support of the material style for the swing components and also support the java9 modules.
In addition, we are entuasiate to annunce that the library was used inside a very big and important project in the Java world (Included inside the best 25 java apps described here) called JMars. In fact JMars is a geospatial information system (GIS) used to study the data built from the most important space missions, like Mars 2020 developed by Nasa and Hope developed by United Arab Emirates (UAE).
JMARS is an acronym that stands for Java Mission-planning and Analysis for Remote Sensing. It is a geospatial information system (GIS) developed by ASU's Mars Space Flight Facility to provide mission planning and data-analysis tools to NASA scientists, instrument team members, students of all ages and the general public. JMARS has been available to the public since 2003. It is used in over 65 countries and has over 6,000 active users.
Also, Arizona State University is a founder/supporter with donations. In fact, ASU contribute to make possible the work on this library such as a open source library open for all people. Thanks to do this.
After a short summary with the a shor description of people that are helping me to develop this open source library. I want introduce the news inside the library, and they are a few. Before all, all stable versions of the library will bring a name in addition to the version number.
This version will be call Gotham and the mascotte of this version is Bane.
The news inside the library are:
<dependency>
<groupId>io.github.vincenzopalazzo</groupId>
<artifactId>material-ui-swing</artifactId>
<version>1.1.1</version>
</dependency>
Groovy
implementation 'io.github.vincenzopalazzo:material-ui-swing:1.1.1'
Kotlin
implementation("io.github.vincenzopalazzo:material-ui-swing:1.1.1")
io.github.vincenzopalazzo.materialuiswing
Before all, I want to say thanks to all people that help me to improve the library and to make the version 1.1.1, so thanks @zanderson9, @metteo, @jarek-insys, @mikera
Also, I want to say thank all people that are using and testing the library.
Maven data
If you like the library and want support it, please considerer to donate with the following system
Material-UI-Swing pre-release 6.1
This version includes the complete refactoring to JButton and restored all change inside the JTable (the code of the table UI is equal to code the version 1.1.1_beta material-ui-swing version).
The old version of MaterialButtonUI had a bad code inside the implementation and this caused the bad performance with a complex client application, how JMars, an example mouse hover event on Jbutton worked bad or ware very slow. The version 1.1.1 pre-release 6.1 (over to have an ugly name :smile:) introduce a big refactoring inside the component UI, and change/simplifies the API of JButton if you want to create a personal UI.
as well as to disabled the mouse hovers on the Jbutton, you can disable the focus (borders dashed) and the button pressed effect.
With order.
to paint the button with no mouse hover effect you can use this code, described in vincenzopalazzo/material-ui-swing issues.
to disabled border dashed there are two possible methods, like:
@Override
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) {
paintBorderButton(g, b);
}
To disabled button pressed effect you can override inside the personal UI component the method called paintButtonPressed with code like the following:
@Override
protected void paintButtonPressed(Graphics g, AbstractButton b) {
g.setColor(background);
g.fillRoundRect(0, 0, b.getWidth(), b.getHeight(), arch, arch);
paintBorderButton(g, b);
}
In the material-ui-swing 1.1.1 pre-release6.1 include refactoring to JTable, before this update the proprieties inside UIDefault was:
UIManager.put("Table.alternateRowColor", true);
UiManager.put("Table.alternateRowBackground", Color.RED);
and inside the MaterialTableCellRenderer the code was:
public class MaterialTableCellRenderer extends DefaultTableCellRenderer {
@Override
public Component getTableCellRendererComponent (JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
JComponent component = (JComponent) super.getTableCellRendererComponent (table, value, isSelected, hasFocus, row, column);
// hides yellow selection highlight
this.setHorizontalAlignment (SwingConstants.CENTER);
this.setVerticalAlignment (SwingConstants.CENTER);
if(value instanceof Boolean){
TableCellRenderer renderer = new MaterialTableCellRendererCheckBox();
return renderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
}
boolean alternativeRow = UIManager.getBoolean("Table.alternateRowColor");
Color alternativeRowColor = UIManager.getColor("Table.alternateRowBackground");
Color normalColor = UIManager.getColor("Table.background");
if(alternativeRow){
if(!isSelected){
if(row%2 == 1) {
component.setBackground(alternativeRowColor);
setDefaultCellRenderWithAllType(table, value, isSelected, hasFocus, row, column, alternativeRowColor);
}else{
component.setBackground(normalColor);
setDefaultCellRenderWithAllType(table, value, isSelected, hasFocus, row, column, normalColor);
}
component.setForeground(table.getForeground());
}else {
component.setForeground(table.getSelectionForeground());
}
}
return component;
}
// This method sets a MaterialCellRender at the particular class
// With this class not working correctly the color alternate in the Jtable
// in particular the IconImage without this code the cell is painted not correctly or
// in the cell did print the path of the image
protected void setDefaultCellRenderWithAllType(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column, Color color) {
if(table == null){
throw new IllegalArgumentException("Table is null");
}
Component component = table.getDefaultRenderer(ImageIcon.class).getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
component.setBackground(color);
}
}
Now the code is refactorized and the UIManager proprieties are changed in
table.put("Table.alternateRowColor", Color.RED);
Now the paint row is managed to DefaultTableCellRenderer and if you create the PersonalTableCellRenderer, you can extend the API class (DefaultTableCellRenderer) and not MaterialTableCellRenderer
Now the implementation of JButton is a lot of personalizable but it is possible to increase the modularization of the component MaterialButtonUI. For the moment the version remains this because another refactoring can introduce a few bugs inside the component behavior
Other changes are described inside the CHANGELOG file
To support my work in this version you can use
or
I have created the new label to create a little documentation to material-ui-swing, you can see the label doc and here
JFrame.setDefaultLookAndFeelDecorated(true);
With MaterialTabbedPane is possible now enable the scrollabe view, for some detail , you can look docuementation
This is the result
But exist an bug, look the bug 1 in the know bug
Without the scrollable view you can have the angular material effect when the is setter JTabbledPane.TOP, this is the result
Without the JTabbledPane.TOP, so JTabbledPane.LEAF, ecc you have the old version style, like this:
The demo is update, you can play with it, but have the partial support to the Material theme.
Maven
<dependency>
<groupId>io.github.vincenzopalazzo</groupId>
<artifactId>material-ui-swing</artifactId>
<version>1.1.1_beta</version>
</dependency>
Gradle
implementation 'io.github.vincenzopalazzo:material-ui-swing:1.1.1_beta'
Others version here
This version is more stable and more optimized.
If you like my work, I will happy if you buy me the christmas movie or you can see the my Github donator site
Updating releases to catch up with the latest master
Haven't updated this in a while oops
Small bug with JTextFields is no more
JButtons with icons now display properly