Results 1 to 9 of 9
  1. #1
    heman is offline Member
    Join Date
    Aug 2012
    Posts
    39
    Rep Power
    0

    Default how to change font size of input text in awt in textfield

    hello,
    I wish to change the font size of the text in text field.I wish that the font should be of bigger size.
    I am trying to design a calculator and input is taken from clicking the buttons only.
    Please help me in light of awt only.
    I have take look at java doc and found that it is in java.awt.font package and textAttribute is responsible but unable to resolve issue.'
    thanks.,
    regards.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,984
    Rep Power
    9

    Default Re: how to change font size of input text in awt in textfield

    Why are you using AWT and not Swing?

    What did the API for TextField tell you?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

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

    Default Re: how to change font size of input text in awt in textfield

    Moved from New to Java

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

  4. #4
    heman is offline Member
    Join Date
    Aug 2012
    Posts
    39
    Rep Power
    0

    Default Re: how to change font size of input text in awt in textfield

    Quote Originally Posted by KevinWorkman View Post
    Why are you using AWT and not Swing?

    What did the API for TextField tell you?
    I am not using Swing becoz till now I dont know swing and i am a new learner in java.

    and for Textfield i did not understand about font

  5. #5
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,984
    Rep Power
    9

    Default Re: how to change font size of input text in awt in textfield

    Swing has pretty much replaced AWT. You should probably be using that instead.

    But either way your answer lies in searching the API: Java Platform SE 7
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    heman is offline Member
    Join Date
    Aug 2012
    Posts
    39
    Rep Power
    0

    Default Re: how to change font size of input text in awt in textfield

    Quote Originally Posted by KevinWorkman View Post
    Swing has pretty much replaced AWT. You should probably be using that instead.

    But either way your answer lies in searching the API: Java Platform SE 7
    I had looked ,i think SIZE is required but i am unable to use.I wish to have a syntax for that,if u can provide me with that.
    thanks

  7. #7
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,984
    Rep Power
    9

    Default Re: how to change font size of input text in awt in textfield

    You are looking for a way to set the font. Start there.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  8. #8
    heman is offline Member
    Join Date
    Aug 2012
    Posts
    39
    Rep Power
    0

    Default Re: how to change font size of input text in awt in textfield

    Quote Originally Posted by KevinWorkman View Post
    You are looking for a way to set the font. Start there.
    where?
    I dont get u.
    can i get a little program for that or syntax only!

  9. #9
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,404
    Rep Power
    20

    Default Re: how to change font size of input text in awt in textfield

    Quote Originally Posted by heman View Post
    I dont get u.
    Please take the trouble to spell words in full. This is a programming forum, not SMS chat.

    Read the API for javax.swing.JTextField and follow the link to the tutorial. You'll find enough sample code there.

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

Similar Threads

  1. Replies: 5
    Last Post: 01-05-2014, 09:12 PM
  2. how can I change font size?
    By rippon in forum AWT / Swing
    Replies: 6
    Last Post: 11-10-2011, 02:42 PM
  3. How to change font of text?
    By sandeep43 in forum New To Java
    Replies: 3
    Last Post: 06-30-2011, 06:01 AM
  4. Change the Font Size and Text Position
    By stayfierce in forum New To Java
    Replies: 1
    Last Post: 12-03-2009, 05:17 AM
  5. Replies: 4
    Last Post: 02-22-2009, 06:31 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
  •