Solved

Bold text i JButton

Posted on 2009-04-07
3
247 Views
Last Modified: 2013-11-23
How do I create a JButton with bold text on it.
0
Comment
Question by:mdoland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jdbc error in jsp application 20 74
Eclipse with various Java releases 7 54
collection output issue 9 69
jsp error 6 49
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

696 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