Skip to content

Commit 3c31dda

Browse files
authored
Merge pull request atarw#25 from vincenzopalazzo/master
add support jprogressbar
2 parents 3ed9f11 + cbfcdd1 commit 3c31dda

17 files changed

+808
-365
lines changed

.gitignore

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

.idea/workspace.xml

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

.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>material-ui-swing</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ public class MaterialUISwingDemo {
3636
frame.add (content, BorderLayout.CENTER);
3737

3838
// on hover, button will change to a light blue
39+
<<<<<<< refs/remotes/upstream/master
3940
MaterialUIMovement.add (button, MaterialColors.LIGHT_BLUE_500);
41+
=======
42+
MaterialUIMovement.add (button, MaterialColors.BLUE_400);
43+
>>>>>>> fix support for jscrollbar
4044

4145
frame.pack ();
4246
frame.setVisible (true);

lib/material-ui-swing.jar

-1.46 KB
Binary file not shown.

src/MaterialUISwingDemo.java

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

55
import javax.swing.JButton;
6-
import javax.swing.JCheckBox;
76
import javax.swing.JComboBox;
87
import javax.swing.JFrame;
98
import javax.swing.JLabel;
109
import javax.swing.JMenu;
1110
import javax.swing.JMenuBar;
1211
import javax.swing.JMenuItem;
1312
import javax.swing.JPanel;
14-
import javax.swing.JPasswordField;
15-
import javax.swing.JRadioButton;
16-
import javax.swing.JScrollPane;
13+
import javax.swing.JProgressBar;
1714
import javax.swing.JSlider;
18-
import javax.swing.JSpinner;
19-
import javax.swing.JTabbedPane;
20-
import javax.swing.JTable;
21-
import javax.swing.JTextField;
22-
import javax.swing.JToggleButton;
2315
import javax.swing.JToolBar;
24-
import javax.swing.JTree;
25-
import javax.swing.SpinnerListModel;
2616
import javax.swing.UIManager;
2717
import javax.swing.UnsupportedLookAndFeelException;
18+
19+
import com.sun.xml.internal.ws.org.objectweb.asm.Label;
20+
2821
import java.awt.BorderLayout;
2922
import java.awt.Dimension;
3023

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

6457
JPanel content = new JPanel ();
6558
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);
6690

6791
// add everything to the frame
6892
frame.add (bar, BorderLayout.PAGE_START);
69-
// frame.add (content, BorderLayout.CENTER);
93+
frame.add (content, BorderLayout.CENTER);
7094

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

117106
// make everything visible to the world
118107
frame.pack ();

src/imgs/lefth_arrow.png

147 Bytes
Loading

src/imgs/slider_point.png

516 Bytes
Loading

0 commit comments

Comments
 (0)