Java Swing Tutorial - Java BasicStroke.getDashArray()








Syntax

BasicStroke.getDashArray() has the following syntax.

public float[] getDashArray()

Example

In the following code shows how to use BasicStroke.getDashArray() method.

//  ww w  .  j  a  v  a2  s .c o  m
import java.awt.BasicStroke;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    BasicStroke stroke = new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0.1F);
    System.out.println(Arrays.toString(stroke.getDashArray()));

  }
}

The code above generates the following result.