Monday, 13 February 2012

How would you create a button with rounded edges? | Core Java

there's 2 ways to create a button with rounded edges.
 The first thing is to know that a JButton's edges are drawn by a Border. so we can override the Button's paintComponent or Graphics method and draw a circle or rounded rectangle and turn off the border. Or we can create a custom border that draws a circle or rounded rectangle around any component and set the button's border to it.