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
Solved

Bold text i JButton

Posted on 2009-04-07
3
242 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error in @AspectJ Based AOP with Spring 2 18
Adding multiple JVM environments to RedHat 6 7 47
ejb mdb examples 1 7
java imports not found 4 25
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

839 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