Bold text i JButton

How do I create a JButton with bold text on it.
mdolandAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
CEHJConnect With a Mentor Commented:
Easiest
b.setText("<html><b>BOLD</b></html>");

Open in new window

0
 
InteractiveMindConnect With a Mentor Commented:
Or the not-so-easy way,
b.setFont(new Font(b.getFont().getFontName(), Font.BOLD, b.getFont().getSize());
b.setText("BOLD");

Open in new window

0
 
CEHJCommented:
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.