Results 1 to 2 of 2
  1. #1
    tim8w is offline Member
    Join Date
    Jan 2013
    Posts
    14
    Rep Power
    0

    Cool JButton User Draw Text?

    Hi,
    I am new to Java but not to GUI programming. I have created a JButton with both an Icon and Text on the center of the button. The problem I have is that the control thinks the text is too big to fit on the button and draws the text as "...". Pixel-wise it will fit just fine. Is there a way for me to draw the text myself?
    Last edited by tim8w; 01-21-2013 at 06:59 AM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: JButton User Draw Text?

    Don't set sizes or preferredSizes. Use layout managers correctly.

    db

    edit And controls don't think but, unfortunately for them, programmers sometimes think a little too much ;)
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. New AWT/SWING user, help in JButton
    By corrax in forum AWT / Swing
    Replies: 7
    Last Post: 04-02-2011, 03:27 AM
  2. draw shape with user defined values
    By cka in forum New To Java
    Replies: 4
    Last Post: 07-14-2010, 03:35 PM
  3. How to draw and delete according to user input?
    By ProspectiveDeveloper in forum AWT / Swing
    Replies: 8
    Last Post: 04-22-2010, 11:58 PM
  4. How to draw text along a curve
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-25-2008, 10:31 AM
  5. How to Draw Text in Java
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-23-2008, 11:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •