Java Graphics Draw Border drawSquareBorder(Graphics2D g, int x, int y, int width, int height, int rounding, Color color, float strokeWidth)

Here you can find the source of drawSquareBorder(Graphics2D g, int x, int y, int width, int height, int rounding, Color color, float strokeWidth)

Description

draw Square Border

License

Open Source License

Declaration

public static void drawSquareBorder(Graphics2D g, int x, int y, int width, int height, int rounding,
            Color color, float strokeWidth) 

Method Source Code


//package com.java2s;
import java.awt.*;

public class Main {
    public static void drawSquareBorder(Graphics2D g, int x, int y, int width, int height, int rounding,
            Color color, float strokeWidth) {
        Stroke stroke = g.getStroke();
        g.setColor(color);//from  w  w  w.j  a  v a  2  s.  co m
        g.setStroke(new BasicStroke(strokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER));
        g.drawRect(x, y, width, height);
        g.setStroke(stroke);
    }
}

Related

  1. drawBorder(Graphics2D g2d, Color borderColor, int x, int y, int width, int height)
  2. drawButtonBorder(Graphics g, int x, int y, int w, int h, Color backgroundColor, Color edgeColor, Color cornerColor)
  3. drawDirectionalTriangle(Graphics2D bbg, double heading, double x, double y, double sideLength, Color fillColor, Color borderColor)
  4. drawEtchedBorder(Graphics g, int x, int y, int width, int height, Color dark, Color bright)
  5. drawHighlightBorder(Graphics g, int x, int y, int width, int height, boolean raised, Color shadow, Color highlight)
  6. paintBorder(Graphics g, int borderType, Insets insets, Color[] colors, int width, int height)
  7. paintBorder(Rectangle r, Graphics2D g2d)
  8. paintBorderDebugInfo(final Graphics g, final JComponent c, final Color color)
  9. paintBorderGlow(final Graphics2D g2, final Shape shape, final int glowWidth)