public static ImageIcon createIcon(BasicStroke stroke,int width,int height,boolean horizontalOrientation){
  BufferedImage bigImage=new BufferedImage(width,height,BufferedImage.TYPE_INT_ARGB);
  Graphics2D g=(Graphics2D)bigImage.getGraphics();
  g.setBackground(OMColor.clear);
  g.setPaint(OMColor.clear);
  g.fillRect(0,0,width,height);
  g.setPaint(Color.black);
  g.setStroke(stroke);
  if (horizontalOrientation) {
    g.drawLine(0,height / 2,width,height / 2);
  }
 else {
    g.drawLine(width / 2,0,width / 2,height);
  }
  return new ImageIcon(bigImage);
}

public static ImageIcon createIcon ( BasicStroke stroke , int width , int height , boolean horizontalOrientation ) { BufferedImage bigImage = new BufferedImage ( width , height , BufferedImage . TYPE_INT_ARGB ) ; Graphics2D g = ( Graphics2D ) bigImage . getGraphics ( ) ; g . setBackground ( OMColor . clear ) ; g . setPaint ( OMColor . clear ) ; g . fillRect ( 0 , 0 , width , height ) ; g . setPaint ( Color . black ) ; g . setStroke ( stroke ) ; if ( horizontalOrientation ) { g . drawLine ( 0 , height / 2 , width , height / 2 ) ; } else { g . drawLine ( width / 2 , 0 , width / 2 , height ) ; } return new ImageIcon ( bigImage ) ; }
given a basicstroke , create an imageicon that shows it .
