Using my returned font and implimenting it into my JTextArea from my return statement.

Posted on 2005-04-25
Last Modified: 2013-12-03
I used the fontChooser class that is here: I then have it running the getNewFont method. Now how do I take that font and make the font in my JTextArea, I'm using the name chatArea, the same? I know that getNewFont(); returns newFont, but I don't know what to do with that to make it work on one of my JTextArea's. I tried dong the following:


I thought that would work, but I've had no success, could anyone help?
Question by:jasoncuevas
    LVL 92

    Expert Comment

    That should work
    LVL 92

    Accepted Solution

    check that getNewFont() is actually returning the font instance you are expecting

    Font f = chooser.getNewFont();

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now