Someone knows how to change the font of a JTextField ?

I tried almost everything, but I still can't change the Font of a JTextField...
Thanks anyway...

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Testing extends JFrame
  JTextField tf = new JTextField("Hello World");
  public Testing()
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setLocation(400,300);
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    String[] fonts = ge.getAvailableFontFamilyNames();
    final JComboBox cbo = new JComboBox(fonts);
    getContentPane().add(tf,BorderLayout.NORTH);
    getContentPane().add(cbo,BorderLayout.SOUTH);
    pack();
    cbo.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent ae){
        tf.setFont(new Font((String)cbo.getSelectedItem(),Font.PLAIN,12));}});
  public static void main(String args[]){new Testing().setVisible(true);}
}

Similar Messages

  • The fonts on my facebook page is set to approximately 200%. This problem is only on my facebook page. Does anyone know how to change the font size on this page?

    I do not know how I changed the font size on my face book page I have tried everything to change the font size to 100% but have failed. Any suggestions?

    Hi,
    From your description, you want to know how to edit a page in SharePoint 2013.
    Go to the page->click Settings->Edit page,refer to the following screenshot:
    If a user want to edit a page, he at least have edit permissions.
    If you have any problems, please don't hesitate to let me know.
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to change the font size of text element in smartform

    Hi
    i want to know how to change the font size of text element in smartform
    regards
    Gincy

    Hi
    You can create Smartstyles, in which you can define paragraph formats for texts and character formats for character level changes.
    Paragraph format ---> alignment, font size etc
    character format for ---> superscript, subscript.
    After creating, in your smartform, there will be a option in the text element to enter a style.
    You give the created style and you can use the paragraph and character formats i that style.
    Hope this is clear..
    Regards
    Sekar

  • How to change the font size of Text box tool ?

    How to change the font size of Text box tool ?
    I am using Acrobat PDF 6.0
    Tools > Advanced Commenting > Text Box Tool
    I need to know how to change the font size. The default font size is too big.
    let me know
    Thanks

    I do not have AA6 available right now (I can check at home this evening). I am also using AA Pro, not Std. In AA7, there is a text box tool that is a commenting tool. When I started typing, a properties toolbar came up that had the font size and such. I haven't figured out how to get the toolbar after the fact. In AA8, I selected the text box tool and then went to view and selected the properties bar (the font size and all showed then), or use Ctrl-E when editing the text. I have not been able to figure out how to edit the text in a text box after you have created it - think it is a mental block right now. Bill

  • I just want to know that how to change the font color, font size, and forgr

    i just want to know that how to change the font color, font size, and forground color in JTextPane for the Selected text. i try diffrerent menthod like setFont and setColor, these methods change the fonts of the whole textpane. so please reply me as soon as possible, and thanks in advance.
    Moazzam

    Sell the Old one... Buy a New one...

  • How to change the font size and style on run time

    dear all
    i try to change the font style and font size on runtime. I did the following:
    1- i created an item(:font_size) in which i will write the size of the font for the the other item ('customer_name')
    2 on the post_change trigger for 'font_size' i write this code
    SET_ITEM_PROPERTY('customer_name',FONT_size,(:font_size);
    i write 12 then then font size changed , then i write 18 , the size does not change. and when i write any value , no change happens. I do not know why
    the second problem is how to change the font style
    i made three checkbooks (bold,italic,underline)
    on the trugger when_checkbox_checked i write
         IF :BOLD = 'B' THEN
         SET_ITEM_PROPERTY('N_SAMPLE',FONT_STYLE,'BOLD');
         ELSE
    SET_ITEM_PROPERTY('N_SAMPLE',FONT_STYLE,'REGULAR');
         END IF;     
    no change happend at all.
    please help

    Hi friend,
    it's a really really strange tip... May be it's a Forms bug? I've tried with set_item_property..and.. you're right, it doesn't work..
    So.. you can try making this:
    - create a visual attribute with an specific font size....
    - use the
    SET_ITEM_INSTANCE_PROPERTY('block.item',CURRENT_RECORD,VISUAL_ATTRIBUTE,'you_visual_attribute');
    and call it from psot-change....
    It works
    Hope it helps,
    Jose.

  • I like the mail feature with one exception; I cannot figure out how to change the font size of incoming mail permanently.  And, when answering an email I have to highlight the first few words and zoom it so I can see what I am writing.  what am I missing?

    I like the mail feature with one exception; I cannot figure out how to change the font size of incoming mail permanently.  And, when answering an email I have to highlight the first few words and zoom it so I can see what I am writing.  what am I missing?

    You can type the email using what you set in preferences and then highlight the text and use command - minus sign (or command - + for larger) to reduce the size of the text.
    You can also type command - T and a window will appear allowing you to select fonts/sizes/color/ background highlight.
    The above works in Notes also. I haven't tried to do this in any other Apple application.
    For incoming emails, you can use the above to reduce font size, but I don't know of a way to permanently set the incoming font size to a default.

  • I was rubbing my keys and screwed up my font setting. i don't know how to reset the font to original mozilla setting

    i was rubbing my laptop keys. i must have hit the right key sequence to change the font setting. i don't know how to reset the font. i was in mozilla at the time, so only it was affected. IE still uses the correct webpage fonts. IE has a reset on their browser, does firefox?

    Have you tried closing Firefox and visiting the site again without restoring your session? This will bypass any temporary changes.
    If the problem is the font size, you can reset the zoom level:
    View menu > Zoom > Reset
    If you have the orange Firefox button, tap the Alt key or press F10 to display the classic menu bar where you will find the View menu.
    If that doesn't help, can you describe what's different in more detail?

  • Hi! Does someone know how to change a license? I bought for Photoshop but i want to change to Indesign!

    Hi! Does someone know how to change a license? I bought for Photoshop but i want to change to Indesign!

    Hi MariaNilsson,
    You will need to contact the support through call/chat for the cancellation of the Photoshop license and then you can subscribe for the Indesign license under your account.
    Contact Customer Care
    Regards,
    Sheena

  • I have three email accounts and want to know how to change the display order.

    I have three email accounts and want to know how to change the display order.

    Install this add on.
    https://addons.mozilla.org/en-US/thunderbird/addon/manually-sort-folders/?src=search

  • I recently changed my apple ID but my previous apple ID is associated with my icloud account. I'm setting up my new iphone 6 and cannot complete the set up until I can sync my icloud account. Does anyone know how to change the icloud id?

    I recently changed my apple ID but my previous apple ID is associated with my icloud account. I'm setting up my new iphone 6 and cannot complete the set up until I can sync my icloud account. Does anyone know how to change the icloud id?

    Do the following:
    Make sure you are signed into iMessage and FaceTime with your current ID.  If they are signed into the old ID, go to Settings>Messages>Send & Receive and Settings>FaceTime, tap the ID, sign out, then sign back in with your current ID.
    Then temporarily recreate the old ID by going to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  (You should not have to verify the old email account so it doesn’t matter if you no longer have access to it.)  Now go to Settings>iCloud, turn off Find My iPhone and enter your current password when prompted (even though it prompts you for the password for your old ID).  Then go to Settings>iCloud, tap Sign Out and choose Delete from My iPhone when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address back to the way it was.  Now you can go to Settings>iCloud and sign back in with your current iCloud ID and password (your data will download back to your phone).

  • Does anyone know how to change the settings for siri as all he keeps saying to me is he can only look up businesses in the u.s

    my siri seems to be a bit confused as he thinks im in america but im in northern ireland is ther anyone who knows how to change the settings as i cant find them alsao he doesnt understand a word im saying

    To use another iCloud backup, you have to erase all content and settings or restore it. Either gets you to the backup/setup page.
    http://support.apple.com/kb/HT1766

  • HT4356 I have two printers on my network.  Does anyone know how to change the printer nomenclature - Officejet Pro 8600  (0B54AF) to a recognizable name...like Brad's Office?

    I have two printers on my network.  Does anyone know how to change the printer nomenclature - Officejet Pro 8600  (0B54AF) to a recognizable name...like Brad's Office when you use Airprint?

    You would have to change that in the printer's settings on the printer, if that option is offered by the manufacturer. The iPhone just finds printers on the network and uses the name they have given themselves or that were given to them when they were set up.

  • Why doesn't siri know how to change the time of a reminder? When asked, "Do you want to confirm or cancel your reminder?" Reply, "Can I change the time to a half hour later?" Siri doesn't know how to respond.

    Why doesn't siri know how to change the time of a reminder? When asked, "Do you want to confirm or cancel your reminder?" Reply, "Can I change the time to a half hour later?" Siri doesn't know how to respond.

    Hi
    In iMovie'11 (version 9.0.x)
    on top menu row - Apple/iMovie/File/Edit/Cut (Can vary dep. on language - in Swedish Apple/iMovie/Arkiv/Redigera/Klipp . . . )
    down Cut menu - Slow playback/Raspid Playback/Re-play in Slow Motion and onvards
    Here one can select the Pre-Set speeds
    Are you familiar with getting 'inspector' to run?
    No - but I guess that Double Click on clip/sequense or ctrl-Click on it might open it.
    Yours Bengt W

  • Does anyone know how to change the copy on a pdf made in Indesign?  I don't have that software on my Mac

    Does anyone know how to change the text on a pdf made in Indesign when my Mac doesn't have that software?   Thanks,

    If you don't have access to Acrobat Pro or Nitro PDF Pro,  see this article:
    http://www.labnol.org/software/edit-pdf-files/10870/

Maybe you are looking for

  • How do I get my videos to play their sound over my soundtrack?

    I have been working on my project for quite some time, and have figured this out at one point, however, I cannot remember how to solve my problem. I have uploaded videos into my imovie project, however, I cannot hear the sound of these videos over my

  • How to expose custom methods of servlet as web services

    Can i know how to expose the custom methods of the servlet as web services. if it is not posssible then what alternate ways are possible other than ejbs? regards

  • Garageband exports file with wrong filename

    I have been using garageband to export our church's podcasts for 3 years now. But for the last two weeks the poscast filename ends up being the same file from 3 weeks ago. I have a file that I use as a starter template. I import the new audio and sav

  • Is AIR 3.5 compatible with iOS 7?

    title says it all

  • Contextual menu from desktop

    I noticed an unusual, but useful, contextual menu from my desktop today. It said "Clean Up" as it pertained to the alignment of icons on the desktop. I had first tried to put my dock on the right side of my screen. I haven't used it there because the