--- /home/cpdev/src/classpath/javax/swing/plaf/basic/BasicProgressBarUI.java	2005-07-02 21:04:07.000000000 +0000
+++ javax/swing/plaf/basic/BasicProgressBarUI.java	2005-06-30 05:35:19.000000000 +0000
@@ -48,9 +48,6 @@
 import java.awt.Rectangle;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.awt.font.FontRenderContext;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 
@@ -75,12 +72,8 @@
   /**
    * A helper class that listens for ChangeEvents 
    * from the progressBar's model.
-   *
-   * @specnote Apparently this class was intended to be protected,
-   *           but was made public by a compiler bug and is now
-   *           public for compatibility.
    */
-  public class ChangeHandler implements ChangeListener
+  protected class ChangeHandler implements ChangeListener
   {
     /**
      * Called every time the state of the model changes.
@@ -388,16 +381,16 @@
   {
     // The only thing we need to worry about is
     // the text size.
+    Graphics g = progressBar.getGraphics();
+
     Insets insets = c.getInsets();
 
-    // make a fontrenderer context so that we can make assumptions about
-    // the string bounds
-    FontRenderContext ctx = new FontRenderContext(new AffineTransform(),
-                                                  false, false);
-    Rectangle2D bounds = c.getFont().getStringBounds(progressBar.getString(),
-                                                     ctx);
-    int textW = (int) bounds.getWidth();
-    int textH = (int) bounds.getHeight();
+    FontMetrics fm = g.getFontMetrics(c.getFont());
+
+    int textW = fm.stringWidth(progressBar.getString());
+    int textH = fm.getHeight();
+
+    g.dispose();
 
     if (progressBar.getOrientation() == JProgressBar.HORIZONTAL)
       {
@@ -496,6 +489,11 @@
       paintDeterminate(g, c);
     else
       paintIndeterminate(g, c);
+      
+    if (progressBar.isBorderPainted())
+      progressBar.getBorder().paintBorder(progressBar, g, 0, 0,
+                                          progressBar.getWidth(),
+					  progressBar.getHeight());
   }
 
   /**
