Styling Swing Components in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Styling Swing Components in java

LIKE in HTML we design elements like buttons and divs using css, how can we style buttons and different components in java? Specifically the swing components... Is there any kind of style sheet that can help? At most about designing button in java i have learned is setBackground() and setFont()... Nothing for hover attributes and border radius kind of a thing? Please help!

28th Sep 2017, 11:36 AM
Anshul Garg
Anshul Garg - avatar
2 Answers
+ 11
If you use JavaFX instead of Swing, you can do the styling with css as well. Not all properties are supported, but it's better than Swing.
4th Oct 2017, 7:54 PM
Tashi N
Tashi N - avatar
+ 1
I got that bit of advice but Finally someone answered thankyou for that at least!
4th Oct 2017, 7:55 PM
Anshul Garg
Anshul Garg - avatar