I'm working on a GUI in Java, and I'm trying to give rounded corners to my borders.
JPanel recentProjectsPanel = new JPanel();
recentProjectsPanel.setLayout(new BorderLayout());
recentProjectsPanel.setBackground(Color.red);
recentProjectsPanel.setBorder(new LineBorder(Color.green, 15, true));
This is the output I get (don't mind the colors):
Why do I get these red stripes in the corners? Any way to fix this?
You might use a variant of the TextBubbleBorder
instead.
Have a look at this
Java - rounded corner panel with compositing in paintComponent
this has much information regarding same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With