Skip to content

Commit 12b8cd6

Browse files
Merge branch 'pull_jprogressbar' into masternow
2 parents 2d75808 + 06ce784 commit 12b8cd6

37 files changed

+745
-868
lines changed

.classpath

Lines changed: 0 additions & 7 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
*.java~
22
*.class
3-
out/
4-
/bin/
3+
out/

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

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

.project

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class MaterialUISwingDemo {
3636
frame.add (content, BorderLayout.CENTER);
3737

3838
// on hover, button will change to a light blue
39-
MaterialUIMovement.add (button, MaterialColors.BLUE_400);
39+
MaterialUIMovement.add (button, MaterialColors.LIGHT_BLUE_500);
4040

4141
frame.pack ();
4242
frame.setVisible (true);

lib/material-ui-swing.jar

1.46 KB
Binary file not shown.

src/MaterialUISwingDemo.java

Lines changed: 54 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,29 @@
33
import mdlaf.resources.MaterialColors;
44

55
import javax.swing.JButton;
6+
import javax.swing.JCheckBox;
67
import javax.swing.JComboBox;
78
import javax.swing.JFrame;
89
import javax.swing.JLabel;
910
import javax.swing.JMenu;
1011
import javax.swing.JMenuBar;
1112
import javax.swing.JMenuItem;
1213
import javax.swing.JPanel;
14+
import javax.swing.JPasswordField;
1315
import javax.swing.JProgressBar;
16+
import javax.swing.JRadioButton;
17+
import javax.swing.JScrollPane;
1418
import javax.swing.JSlider;
19+
import javax.swing.JSpinner;
20+
import javax.swing.JTabbedPane;
21+
import javax.swing.JTable;
22+
import javax.swing.JTextField;
23+
import javax.swing.JToggleButton;
1524
import javax.swing.JToolBar;
25+
import javax.swing.JTree;
26+
import javax.swing.SpinnerListModel;
1627
import javax.swing.UIManager;
1728
import javax.swing.UnsupportedLookAndFeelException;
18-
19-
import com.sun.xml.internal.ws.org.objectweb.asm.Label;
20-
2129
import java.awt.BorderLayout;
2230
import java.awt.Dimension;
2331

@@ -56,41 +64,10 @@ public static void main (String[] args) {
5664

5765
JPanel content = new JPanel ();
5866
content.add (button);
59-
60-
//configure JToolBar
61-
JToolBar toolBar = new JToolBar();
62-
toolBar.setRollover(true);
63-
JButton buttonOne = new JButton("button");
64-
toolBar.add(buttonOne);
65-
toolBar.addSeparator();
66-
toolBar.add(new JButton("button 2"));
67-
toolBar.add(new JComboBox(new String[]{"A","B","C"}));
68-
content.add(toolBar);
69-
70-
//Setting comboBox only
71-
JLabel labelCombo = new JLabel();
72-
labelCombo.setText("Combo");
73-
JComboBox<String> comboTest = new JComboBox<String>();
74-
comboTest.addItem("Prova uno");
75-
comboTest.addItem("Prova due");
76-
content.add(labelCombo);
77-
content.add(comboTest);
78-
79-
//settin Slider
80-
JSlider slider = new JSlider();
81-
JSlider sliderVertical = new JSlider(JSlider.VERTICAL);
82-
content.add(slider);
83-
content.add(sliderVertical);
84-
85-
//test Progressbar
86-
JProgressBar progressBar = new JProgressBar();
87-
progressBar.setMaximum(5);
88-
progressBar.setValue(2);
89-
content.add(progressBar);
9067

9168
// add everything to the frame
9269
frame.add (bar, BorderLayout.PAGE_START);
93-
frame.add (content, BorderLayout.CENTER);
70+
// frame.add (content, BorderLayout.CENTER);
9471

9572
// start animating!
9673
// here, 'gray' is the color that the JComponent will transition to when the user hovers over it
@@ -101,7 +78,48 @@ public static void main (String[] args) {
10178
// there will be 5 intermediate colors displayed in the transition from the original components color to the new one specified
10279
// the "frame rate" of the transition will be 1000 / 30, or 30 FPS
10380
// the animation will take 5 * 1000 / 30 = 166.666... milliseconds to complete
104-
MaterialUIMovement.add (button, MaterialColors.BLUE_400, 5, 1000 / 30);
81+
MaterialUIMovement.add (button, MaterialColors.LIGHT_BLUE_500, 5, 1000 / 30);
82+
83+
//
84+
content.add (new JCheckBox ("checkbox"));
85+
content.add (new JComboBox<String> (new String[]{"a", "b", "c"}));
86+
content.add (new JLabel ("label"));
87+
content.add (new JPasswordField ("password"));
88+
content.add (new JRadioButton ("radio button"));
89+
content.add (new JSlider (JSlider.HORIZONTAL, 0, 5, 2));
90+
content.add (new JSpinner (new SpinnerListModel (new String[]{"d", "e", "f"})));
91+
content.add (new JTable (new String[][]{{"a", "b", "c"}, {"d", "e", "f"}}, new String[]{"r", "e"}));
92+
content.add (new JTextField ("text field"));
93+
content.add (new JToggleButton ("toggle"));
94+
95+
JToolBar tb = new JToolBar ("toolbar");
96+
tb.add (new JButton ("f"));
97+
tb.addSeparator ();
98+
tb.add (new JButton ("e"));
99+
tb.setFloatable (true);
100+
content.add (tb);
101+
102+
JTree tree = new JTree (new String[]{"a", "b"});
103+
tree.setEditable (true);
104+
105+
content.add (tree);
106+
107+
JScrollPane sp = new JScrollPane (content);
108+
sp.setHorizontalScrollBarPolicy (JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
109+
sp.setVerticalScrollBarPolicy (JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
110+
111+
JPanel pn = new JPanel();
112+
JTabbedPane tp = new JTabbedPane ();
113+
tp.addTab ("bleh1", pn);
114+
tp.addTab ("bleh", sp);
115+
116+
frame.add (tp, BorderLayout.CENTER);
117+
118+
//test progressBar
119+
JProgressBar progressBar = new JProgressBar();
120+
progressBar.setValue(6);
121+
progressBar.setMaximum(12);
122+
pn.add(progressBar);
105123

106124
// make everything visible to the world
107125
frame.pack ();

src/imgs/lefth_arrow.png

-147 Bytes
Binary file not shown.

src/imgs/slider_point.png

-516 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)