center the text with this setup inside the button

Posted on 2004-04-27
Last Modified: 2011-10-03
How could I center the text with this setup inside the button would it be:


JButton b = new JColoredButton("",,;
          b.setPreferredSize( new Dimension( 40, 20 ) );
          buttons.put("b"+(i+1), b);
     JButton b1 = (JButton) buttons.get("b1");             // this is where I would place them
     b1.setText("Axe Kick");
Question by:Drop_of_Rain
  • 2
  • 2
LVL 92

Accepted Solution

objects earned 75 total points
ID: 10934213

Author Comment

ID: 10934265
That is what I though it would be. I am going to close this question.

I want to ask you a couple of questions so I will post them soon.

Thanks for the help

I am learning so much from you. What I am learning, I think is very important. I am learning to think in less code to do the same job. I have been very impressed with your style of code writing, you have doon just that, less code for the same job. Thanks for being my teacher.
LVL 92

Expert Comment

ID: 10934282
stop it your embarassing me :)

Author Comment

ID: 10934315

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Android studio getdrawable(int) is deprecated 4 81
micro services spring boot application error 3 181
arguments to jar 5 26
What's wrong with this code? 4 22
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

813 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

12 Experts available now in Live!

Get 1:1 Help Now