@@ -90,19 +90,19 @@ primaryStage.show();
9090```
9191Then call the static method:
9292``` java
93- TaskbarProgressbar . showCustomProgress(primaryStage, 50 , 100 , TaskbarProgressbar . Type . NORMAL );
93+ TaskbarProgressbar . showCustomProgress(primaryStage, 0.5 , TaskbarProgressbar . Type . NORMAL );
9494```
9595
9696Well, the code above looks okay, but it's not safe. This functionality isn't supported by every OS.
97- For example on a Linux Ubuntu system it will definitely throw a ` RuntimeException ` because it's only available on <b >Windows 7+</b >
97+ For example on a Linux system it will definitely throw an ` UnsupportedSystemException ` because it's only available on <b >Windows 7+</b >
9898systems.<br >
9999<b >If you use static methods to create taskbar-progressbars you always have to check that the current OS
100100supports this functionality!</b >
101101
102102So let's correct the code:
103103``` java
104104if (TaskbarProgressbar . isSupported()) {
105- TaskbarProgressbar . showCustomProgress(primaryStage, 50 , 100 , TaskbarProgressbar . Type . NORMAL );
105+ TaskbarProgressbar . showCustomProgress(primaryStage, 0.5 , TaskbarProgressbar . Type . NORMAL );
106106}
107107```
108108...now it is safe!
@@ -135,7 +135,7 @@ primaryStage.show();
135135```
136136After that just use the created instance for the operations:
137137```
138- progressbar.showCustomProgress(50, 100 , TaskbarProgressbar.Type.NORMAL);
138+ progressbar.showCustomProgress(0.5 , TaskbarProgressbar.Type.NORMAL);
139139```
140140<b ><i >Note: in this case to check that the OS supports this functionality is unnecessary
141141because the object checks it automatically!</i ></b >
@@ -174,10 +174,10 @@ progressbar.showFullPausedProgress();
174174## More screenshots
175175Some more screenshots about what can you do with this library
176176* A paused progress example:<br >
177- Code: ` progressbar.showCustomProgress(70, 100 , TaskbarProgressbar.Type.PAUSED); ` <br >
177+ Code: ` progressbar.showCustomProgress(0.7 , TaskbarProgressbar.Type.PAUSED); ` <br >
178178![ Paused progress] ( images/paused-progress.jpg )
179179* An error progress example:<br >
180- Code: ` progressbar.showCustomProgress(40, 100, TaskbarProgressbar.Type.ERROR); ` <br >b
180+ Code: ` progressbar.showCustomProgress(0.4, TaskbarProgressbar.Type.ERROR); ` <br >
181181![ Paused progress] ( images/error-progress.jpg )
182182
183183## Full demo
0 commit comments