Home » openjdk-7 » javax » swing » border » [javadoc | source]
javax.swing.border
public class: StrokeBorder [javadoc | source]
java.lang.Object
   javax.swing.border.AbstractBorder
      javax.swing.border.StrokeBorder

All Implemented Interfaces:
    Border, Serializable

A class which implements a border of an arbitrary stroke.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see java.beans.XMLEncoder .

Constructor:
 public StrokeBorder(BasicStroke stroke) 
    Creates a border of the specified {@code stroke}. The component's foreground color will be used to render the border.
    Parameters:
    stroke - the BasicStroke object used to stroke a shape
    Throws:
    NullPointerException - if the specified {@code stroke} is {@code null}
 public StrokeBorder(BasicStroke stroke,
    Paint paint) 
    Creates a border of the specified {@code stroke} and {@code paint}. If the specified {@code paint} is {@code null}, the component's foreground color will be used to render the border.
    Parameters:
    stroke - the BasicStroke object used to stroke a shape
    paint - the Paint object used to generate a color
    Throws:
    NullPointerException - if the specified {@code stroke} is {@code null}
Method from javax.swing.border.StrokeBorder Summary:
getBorderInsets,   getPaint,   getStroke,   paintBorder
Methods from javax.swing.border.AbstractBorder:
getBaseline,   getBaselineResizeBehavior,   getBorderInsets,   getBorderInsets,   getInteriorRectangle,   getInteriorRectangle,   isBorderOpaque,   isLeftToRight,   paintBorder
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.border.StrokeBorder Detail:
 public Insets getBorderInsets(Component c,
    Insets insets) 
    Reinitializes the {@code insets} parameter with this border's current insets. Every inset is the smallest (closest to negative infinity) integer value that is greater than or equal to the line width of the stroke that is used to paint the border.
 public Paint getPaint() 
    Returns the Paint object used to generate a color during the border rendering.
 public BasicStroke getStroke() 
    Returns the BasicStroke object used to stroke a shape during the border rendering.
 public  void paintBorder(Component c,
    Graphics g,
    int x,
    int y,
    int width,
    int height) 
    Paints the border for the specified component with the specified position and size. If the border was not specified with a Paint object, the component's foreground color will be used to render the border. If the component's foreground color is not available, the default color of the Graphics object will be used.