Solved

Bold text i JButton

Posted on 2009-04-07
3
236 Views
Last Modified: 2013-11-23
How do I create a JButton with bold text on it.
0
Comment
Question by:mdoland
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 150 total points
ID: 24085973
Easiest
b.setText("<html><b>BOLD</b></html>");

Open in new window

0
 
LVL 25

Assisted Solution

by:InteractiveMind
InteractiveMind earned 100 total points
ID: 24086079
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 24086778
:-)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now