FileDocCategorySizeDatePackage
MyMetalScrollBarUI.javaAPI DocExample1443Thu Oct 24 20:14:28 BST 2002None

MyMetalScrollBarUI

public class MyMetalScrollBarUI extends MetalScrollBarUI

Fields Summary
Constructors Summary
Methods Summary
public static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent c)

    return new MyMetalScrollBarUI();
  
protected voidpaintThumb(java.awt.Graphics g, javax.swing.JComponent c, java.awt.Rectangle thumbBounds)

    if (!c.isEnabled()) { return; }

    g.translate( thumbBounds.x, thumbBounds.y );
    if ( scrollbar.getOrientation() == JScrollBar.VERTICAL ) {
      if ( !isFreeStanding ) {
        thumbBounds.width += 2;
      }
      g.setColor( Color.black );
      g.fillRect( 0, 0, thumbBounds.width - 2, thumbBounds.height - 1 );
      if ( !isFreeStanding ) {
        thumbBounds.width -= 2;
      }
    }
    else  { // HORIZONTAL
      if ( !isFreeStanding ) {
        thumbBounds.height += 2;
      }
      g.setColor( Color.black );
      g.fillRect( 0, 0, thumbBounds.width - 1, thumbBounds.height - 2 );
      if ( !isFreeStanding ) {
        thumbBounds.height -= 2;
      }
    }
    g.translate( -thumbBounds.x, -thumbBounds.y );