Results 1 to 3 of 3
  1. #1
    Krooger is offline Member
    Join Date
    Nov 2008
    Posts
    43
    Rep Power
    0

    Default Change JTextField Font?

    Hello,

    I cannot figure out how to change the font of a JTextField
    I know to use;
    Java Code:
    Font newFont = new Font("DeutscheZierschrift", 0, 16);
    aField.setFont(newFont);
    But I want to use a custom font I have downloaded.
    I put "DeutscheZierschrift.ttf" in the following folder
    java>jre6>lib>fonts

    but when I try to load it in java, the text does not change.

    Anyone know how to get this working?

    Thank You

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default

    But I want to use a custom font I have downloaded.
    Read the Font API. I would guess you need to use the Font.createFont(...) method.

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

    Default

    And please don't put font files in the jre lib folder. That's definitely not the right place for them.

    db

Similar Threads

  1. Change the Font Size and Text Position
    By stayfierce in forum New To Java
    Replies: 1
    Last Post: 12-03-2009, 05:17 AM
  2. Replies: 5
    Last Post: 04-25-2009, 08:00 PM
  3. Replies: 4
    Last Post: 02-22-2009, 06:31 AM
  4. How to change The Font
    By kader in forum New To Java
    Replies: 2
    Last Post: 09-15-2008, 04:09 AM
  5. Replies: 0
    Last Post: 06-25-2008, 10:33 AM

Posting Permissions

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