Search Java Code Snippets


  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.





Java - Code Samples

 Sample 1. Code Sample / Example / Snippet of java.awt.Polygon

    private Polygon getBorderShape(int side) {

Polygon shape = null;

int[] widths = getWidths();

if (widths[side] != 0) {

shape = new Polygon(new int[4], new int[4], 0);

shape.addPoint(0, 0);

shape.addPoint(-widths[(side + 3) % 4], -widths[side]);

shape.addPoint(widths[(side + 1) % 4], -widths[side]);

shape.addPoint(0, 0);

}

return shape;

}


   Like      Feedback      java.awt.Polygon



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner