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

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
Glassfish admin console not working 1 57
Print Rhino Java Array in Javascript 1 36
Java List 4 39
netbeans can not run self signed app 8 12
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

749 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