File tree Expand file tree Collapse file tree 3 files changed +59
-2
lines changed Expand file tree Collapse file tree 3 files changed +59
-2
lines changed Original file line number Diff line number Diff line change 12
12
import javax .swing .JMenuItem ;
13
13
import javax .swing .JPanel ;
14
14
import javax .swing .JPasswordField ;
15
+ import javax .swing .JProgressBar ;
15
16
import javax .swing .JRadioButton ;
16
17
import javax .swing .JScrollPane ;
17
18
import javax .swing .JSlider ;
@@ -107,12 +108,18 @@ public static void main (String[] args) {
107
108
sp .setHorizontalScrollBarPolicy (JScrollPane .HORIZONTAL_SCROLLBAR_ALWAYS );
108
109
sp .setVerticalScrollBarPolicy (JScrollPane .VERTICAL_SCROLLBAR_ALWAYS );
109
110
111
+ JPanel pn = new JPanel ();
110
112
JTabbedPane tp = new JTabbedPane ();
111
- tp .addTab ("bleh1" , new JPanel () );
113
+ tp .addTab ("bleh1" , pn );
112
114
tp .addTab ("bleh" , sp );
113
115
114
116
frame .add (tp , BorderLayout .CENTER );
115
- //
117
+
118
+ //test progressBar
119
+ JProgressBar progressBar = new JProgressBar ();
120
+ progressBar .setValue (6 );
121
+ progressBar .setMaximum (12 );
122
+ pn .add (progressBar );
116
123
117
124
// make everything visible to the world
118
125
frame .pack ();
Original file line number Diff line number Diff line change 10
10
import mdlaf .components .panel .MaterialPanelUI ;
11
11
import mdlaf .components .password .MaterialPasswordFieldUI ;
12
12
import mdlaf .components .popupmenu .MaterialPopupMenuUI ;
13
+ import mdlaf .components .progressbar .MaterialProgressBarUI ;
13
14
import mdlaf .components .radiobutton .MaterialRadioButtonUI ;
14
15
import mdlaf .components .scrollbar .MaterialScrollBarUI ;
15
16
import mdlaf .components .slider .MaterialSliderUI ;
@@ -53,6 +54,11 @@ public class MaterialLookAndFeel extends MetalLookAndFeel {
53
54
private static final String popupMenuUI = MaterialPopupMenuUI .class .getCanonicalName ();
54
55
private static final String toolbarUI = MaterialToolBarUI .class .getCanonicalName ();
55
56
private static final String sliderUI = MaterialSliderUI .class .getCanonicalName ();
57
+ private static final String progressBarUI = MaterialProgressBarUI .class .getCanonicalName ();
58
+
59
+ public static String getProgressbarui () {
60
+ return progressBarUI ;
61
+ }
56
62
57
63
@ Override
58
64
public String getName () {
@@ -103,6 +109,7 @@ protected void initClassDefaults (UIDefaults table) {
103
109
table .put ("PopupMenuUI" , popupMenuUI );
104
110
table .put ("ToolBarUI" , toolbarUI );
105
111
table .put ("SliderUI" , sliderUI );
112
+ table .put ("ProgressBarUI" , progressBarUI );
106
113
}
107
114
108
115
@ Override
Original file line number Diff line number Diff line change
1
+ package mdlaf .components .progressbar ;
2
+
3
+ import java .awt .Graphics ;
4
+
5
+ import javax .swing .JComponent ;
6
+ import javax .swing .JProgressBar ;
7
+ import javax .swing .plaf .ComponentUI ;
8
+ import javax .swing .plaf .basic .BasicProgressBarUI ;
9
+
10
+ import mdlaf .resources .MaterialBorders ;
11
+ import mdlaf .resources .MaterialColors ;
12
+ import mdlaf .resources .MaterialDrawingUtils ;
13
+
14
+ /**
15
+ *
16
+ * @author https://github.com/vincenzopalazzo
17
+ *
18
+ */
19
+
20
+ public class MaterialProgressBarUI extends BasicProgressBarUI {
21
+
22
+ public static ComponentUI createUI (JComponent c ) {
23
+ return new MaterialProgressBarUI ();
24
+ }
25
+
26
+ @ Override
27
+ public void installUI (JComponent c ) {
28
+ super .installUI (c );
29
+
30
+ JProgressBar progressBar = (JProgressBar ) c ;
31
+ c .setBorder (MaterialBorders .LIGHT_LINE_BORDER );
32
+ c .setBackground (MaterialColors .GRAY_200 );
33
+ c .setForeground (MaterialColors .LIGHT_BLUE_400 );
34
+ }
35
+
36
+ @ Override
37
+ public void paint (Graphics g , JComponent c ) {
38
+ super .paint (MaterialDrawingUtils .getAliasedGraphics (g ), c );
39
+ }
40
+
41
+
42
+
43
+ }
You can’t perform that action at this time.
0 commit comments