0

I'm working on a project so I need help with borders. I have used rounded borders but in the output there are these edges with the borders and I want them to be transparent or something but just a proper round border.

I did the simple rounded border part - that's it:

 class RoundedBorder implements Border
 {
  int radius;
  RoundedBorder(int radius)
   {
    this.radius = radius;
   }
    public Insets getBorderInsets(Component c) {
    return new Insets(this.radius+1, this.radius+1, this.radius+2, this.radius);
}
public boolean isBorderOpaque()
 {
return true;
}
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
 g.setColor(new Color(160,160,160));
 g.drawRoundRect(x,y,width-1,height-1,radius+2,radius+2);

 }

screen capture

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
shriya
  • 1

0 Answers0