Skip to content

Commit 1fe2bbb

Browse files
author
atarw
committed
added better support for jtextfields
1 parent 5f41627 commit 1fe2bbb

File tree

7 files changed

+323
-39
lines changed

7 files changed

+323
-39
lines changed

.idea/workspace.xml

Lines changed: 136 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/material-ui-swing.jar

6.08 KB
Binary file not shown.

src/MaterialUISwingDemo.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import javax.swing.JMenuBar;
88
import javax.swing.JMenuItem;
99
import javax.swing.JPanel;
10+
import javax.swing.JTextField;
1011
import javax.swing.UIManager;
1112
import javax.swing.UnsupportedLookAndFeelException;
1213
import java.awt.BorderLayout;
@@ -49,9 +50,16 @@ public static void main (String[] args) {
4950
JPanel content = new JPanel ();
5051
content.add (button);
5152

53+
54+
JTextField textField = new JTextField (20);
55+
56+
JPanel content2 = new JPanel ();
57+
content2.add (textField);
58+
5259
// add everything to the frame
5360
frame.add (bar, BorderLayout.PAGE_START);
5461
frame.add (content, BorderLayout.CENTER);
62+
frame.add (content2, BorderLayout.PAGE_END);
5563

5664
// start animating!
5765
// in the first example, new Color (230, 230, 230) is the color that the JComponent will transition to when the user hovers over it

src/mdlaf/MaterialColors.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package mdlaf;
2+
3+
import java.awt.Color;
4+
5+
public class MaterialColors {
6+
7+
public static final Color LIGHT_GRAY = new Color (230, 230, 230);
8+
public static final Color LIGHT_BLUE = new Color (25, 181, 254);
9+
10+
public static Color bleach (Color color, float amount) {
11+
int red = (int) ((color.getRed () * (1 - amount) / 255 + amount) * 255);
12+
int green = (int) ((color.getGreen () * (1 - amount) / 255 + amount) * 255);
13+
int blue = (int) ((color.getBlue () * (1 - amount) / 255 + amount) * 255);
14+
return new Color (red, green, blue);
15+
}
16+
}

0 commit comments

Comments
 (0)