src/java.desktop/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java
changeset 51901 3f5a55b6bad8
parent 47216 71c04702a3d5
--- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java	Thu Jul 19 10:53:38 2018 -0700
+++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java	Wed Jul 25 15:36:37 2018 +0530
@@ -874,7 +874,7 @@
                                                       progressString);
 
         if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) {
-            return new Point(x + Math.round(width/2 - stringWidth/2),
+            return new Point(x + (int)Math.round(width/2.0 - stringWidth/2.0),
                              y + ((height +
                                  fontSizer.getAscent() -
                                  fontSizer.getLeading() -
@@ -882,7 +882,7 @@
         } else { // VERTICAL
             return new Point(x + ((width - fontSizer.getAscent() +
                     fontSizer.getLeading() + fontSizer.getDescent()) / 2),
-                    y + Math.round(height/2 - stringWidth/2));
+                    y + (int)Math.round(height/2.0 - stringWidth/2.0));
         }
     }