Results 1 to 3 of 3
  1. #1
    newbie123 is offline Member
    Join Date
    Nov 2009
    Posts
    90
    Rep Power
    0

    Default JTextField and setFont

    When I use the setFont() method on a JTextField, the font size defined by it appears smaller than it should be. For example, if I put a JLabel next to the JTextField and apply setFont() with the same font size to both, the font in JLabel always appears larger than that in JTextField.

    I can monkey around with the fonts to get them to match, but this is a pain in the arse.

    What's going on here?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: JTextField and setFont

    Are all the other Font attributes the same for both?

    To get better help sooner, post a SSCCE (Short, Self Contained, Correct (Compilable), Example) that demonstrates the problem.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    newbie123 is offline Member
    Join Date
    Nov 2009
    Posts
    90
    Rep Power
    0

    Default Re: JTextField and setFont

    All the other attributes are fine; it's just this annoying font size issue.

    Let me cobble something together to demonstrate the problem.

Similar Threads

  1. Replies: 3
    Last Post: 11-14-2011, 06:13 AM
  2. Replies: 0
    Last Post: 08-30-2011, 10:18 AM
  3. setFont GObject help
    By Hollywood_99 in forum New To Java
    Replies: 5
    Last Post: 10-18-2010, 01:18 AM
  4. Can't use SetFont on Eclipse
    By ccie007 in forum New To Java
    Replies: 16
    Last Post: 05-30-2010, 05:56 PM
  5. Replies: 1
    Last Post: 01-30-2009, 07:44 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
  •