Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Interview-Questions How would you create a button with rounded edges?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


samar
How would you create a button with rounded edges?
1 Answer(s)      4 years ago
Posted in : Java Interview Questions


How would you create a button with rounded edges?


Advertisement
View Answers

November 13, 2010 at 1:24 PM


Hi,

Here is the answer,

We can create rounded edge button in two way's, The first thing is to know that a JButton?s edges are drawn by a Border. so you can override the Button?s paintComponent(Graphics) method and draw a circle or rounded rectangle (whatever), and turn off the border. Or you can create a custom border that draws a circle or rounded rectangle around any component and set the button?s border to it.



Related Tutorials/Questions & Answers:
Advertisements
Advertisements
 

 

 

DMCA.com