Skip to content

Commit 34431ee

Browse files
author
atarw
committed
supported filechooser, plus some other small chan
1 parent f5c1c03 commit 34431ee

38 files changed

+640
-473
lines changed

.idea/workspace.xml

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

lib/material-ui-swing.jar

7.6 KB
Binary file not shown.

src/MaterialUISwingDemo.java

Lines changed: 75 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,38 @@
22
import mdlaf.animation.MaterialUIMovement;
33
import mdlaf.resources.MaterialColors;
44

5-
import javax.swing.*;
6-
import java.awt.*;
7-
import java.awt.event.ActionEvent;
5+
import javax.swing.JButton;
6+
import javax.swing.JCheckBox;
7+
import javax.swing.JCheckBoxMenuItem;
8+
import javax.swing.JComboBox;
9+
import javax.swing.JEditorPane;
10+
import javax.swing.JFileChooser;
11+
import javax.swing.JFrame;
12+
import javax.swing.JLabel;
13+
import javax.swing.JMenu;
14+
import javax.swing.JMenuBar;
15+
import javax.swing.JMenuItem;
16+
import javax.swing.JPanel;
17+
import javax.swing.JPasswordField;
18+
import javax.swing.JProgressBar;
19+
import javax.swing.JRadioButton;
20+
import javax.swing.JRadioButtonMenuItem;
21+
import javax.swing.JScrollPane;
22+
import javax.swing.JSlider;
23+
import javax.swing.JSpinner;
24+
import javax.swing.JTabbedPane;
25+
import javax.swing.JTable;
26+
import javax.swing.JTextField;
27+
import javax.swing.JTextPane;
28+
import javax.swing.JToggleButton;
29+
import javax.swing.JToolBar;
30+
import javax.swing.JTree;
31+
import javax.swing.SpinnerListModel;
32+
import javax.swing.UIManager;
33+
import javax.swing.UnsupportedLookAndFeelException;
34+
import java.awt.BorderLayout;
35+
import java.awt.Color;
36+
import java.awt.Dimension;
837

938
public class MaterialUISwingDemo {
1039

@@ -30,15 +59,15 @@ public static void main (String[] args) {
3059
JMenuItem item2 = new JMenuItem ("Item 2 (Not animated)");
3160

3261
//Test RadioButtonMenuItem
33-
JRadioButtonMenuItem jRadioButtonMenuItem = new JRadioButtonMenuItem();
34-
jRadioButtonMenuItem.setText("prova RadioButtonMenuItem");
35-
menu1.add(jRadioButtonMenuItem);
36-
menu1.addSeparator();
62+
JRadioButtonMenuItem jRadioButtonMenuItem = new JRadioButtonMenuItem ();
63+
jRadioButtonMenuItem.setText ("prova RadioButtonMenuItem");
64+
menu1.add (jRadioButtonMenuItem);
65+
menu1.addSeparator ();
3766
//TestCheckBoxMenuItem
38-
JCheckBoxMenuItem checkBoxMenuItem = new JCheckBoxMenuItem();
39-
checkBoxMenuItem.setText("test");
40-
menu1.add(checkBoxMenuItem);
41-
menu1.addSeparator();
67+
JCheckBoxMenuItem checkBoxMenuItem = new JCheckBoxMenuItem ();
68+
checkBoxMenuItem.setText ("test");
69+
menu1.add (checkBoxMenuItem);
70+
menu1.addSeparator ();
4271
menu1.add (item1);
4372
menu2.add (item2);
4473

@@ -47,6 +76,8 @@ public static void main (String[] args) {
4776

4877
// configuring a simple JButton
4978
JButton button = new JButton ("PRESS ME");
79+
button.setBackground (MaterialColors.LIGHT_BLUE_400);
80+
button.setForeground (Color.WHITE);
5081
button.setMaximumSize (new Dimension (200, 200));
5182

5283
JPanel content = new JPanel ();
@@ -80,9 +111,15 @@ public static void main (String[] args) {
80111
content.add (new JToggleButton ("toggle"));
81112

82113
JToolBar tb = new JToolBar ("toolbar");
83-
tb.add (new JButton ("f"));
114+
JButton button1 = new JButton ("f");
115+
JButton button2 = new JButton ("e");
116+
button1.setBackground (MaterialColors.LIGHT_BLUE_400);
117+
button1.setForeground (Color.WHITE);
118+
button2.setBackground (MaterialColors.LIGHT_BLUE_400);
119+
button2.setForeground (Color.WHITE);
120+
tb.add (button1);
84121
tb.addSeparator ();
85-
tb.add (new JButton ("e"));
122+
tb.add (button2);
86123
tb.setFloatable (true);
87124
content.add (tb);
88125

@@ -95,39 +132,42 @@ public static void main (String[] args) {
95132
sp.setHorizontalScrollBarPolicy (JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
96133
sp.setVerticalScrollBarPolicy (JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
97134

98-
JPanel pn = new JPanel();
135+
JPanel pn = new JPanel ();
99136
JTabbedPane tp = new JTabbedPane ();
100137
tp.addTab ("bleh1", pn);
101138
tp.addTab ("bleh", sp);
102139

103140
frame.add (tp, BorderLayout.CENTER);
104-
141+
105142
//test progressBar
106-
JProgressBar progressBar = new JProgressBar();
107-
progressBar.setValue(6);
108-
progressBar.setMaximum(12);
109-
pn.add(progressBar);
143+
JProgressBar progressBar = new JProgressBar ();
144+
progressBar.setValue (6);
145+
progressBar.setMaximum (12);
146+
pn.add (progressBar);
110147

111148
//test cange coloro maximum value progress bar
112-
progressBar = new JProgressBar();
113-
progressBar.setMaximum(5);
114-
progressBar.setValue(5);
115-
pn.add(progressBar);
116-
117-
JTextPane textPane = new JTextPane();
118-
textPane.setText("Hi I'm super sayan");
119-
JTextPane textPane1 = new JTextPane();
120-
textPane1.setText("Hi I'm super sayan");
121-
textPane1.setEnabled(false);
122-
pn.add(textPane);
123-
pn.add(textPane1);
124-
125-
JEditorPane editorPane = new JEditorPane();
126-
editorPane.setText("This theme is fantastic");
127-
pn.add(editorPane);
149+
progressBar = new JProgressBar ();
150+
progressBar.setMaximum (5);
151+
progressBar.setValue (5);
152+
pn.add (progressBar);
153+
154+
JTextPane textPane = new JTextPane ();
155+
textPane.setText ("Hi I'm super sayan");
156+
JTextPane textPane1 = new JTextPane ();
157+
textPane1.setText ("Hi I'm super sayan");
158+
textPane1.setEnabled (false);
159+
pn.add (textPane);
160+
pn.add (textPane1);
161+
162+
JEditorPane editorPane = new JEditorPane ();
163+
editorPane.setText ("This theme is fantastic");
164+
pn.add (editorPane);
128165

129166
// make everything visible to the world
130167
frame.pack ();
131168
frame.setVisible (true);
169+
170+
JFileChooser fileChooser = new JFileChooser ();
171+
fileChooser.showOpenDialog (frame);
132172
}
133173
}

src/imgs/back_arrow.png

123 Bytes
Loading

src/imgs/computer.png

135 Bytes
Loading

src/imgs/details.png

178 Bytes
Loading

src/imgs/file.png

154 Bytes
Loading

src/imgs/floppy_drive.png

175 Bytes
Loading

src/imgs/folder.png

103 Bytes
Loading

src/imgs/hard_drive.png

118 Bytes
Loading

0 commit comments

Comments
 (0)