How can I center text in a JTextArea?

I'm coding my own little font selection frame, and want to display the sample text in a JTextArea, and want to know how I can get the text centered in the field. Does anyone know how this can be done? Thanks.

Thanks Camrick, I'm disappointed that it will take so much to accomplish this. But I'm very appreciative of your response, and I will definitely put that code to use. Just not in time to turn in my assignment, lol. But thats ok, this function was beyond the requirements anyway, I just wanted to put in some bells and whistles.
Cheers!

Similar Messages

  • How do I center text in a JTextArea?

    Easy question! how can I center text being fed into a JTextArea?
    Thank you!!!!!!!!!!!

    Thanks for the reply. You seem to know swing pretty well. Is there a way to change the color of my actual font in a JText Area?
    Thanks again!!!!!!

  • Aperture: How can I center text? or have it left/right?

    hi experts, perhabs you can help me too.
    i know APERTURE quite well but i can't figure out this: how can i change the text layout? i'm looking for a button or so to center the text or have it all on the left or right.
    thanks for helping! rob

    hello
    thanks for your reply.
    i'm referring to the text under a picture in the book or a text in a textbox on a book-page. how can i change its layout (left, centered, richt)?
    thanks a lot, robert

  • How can I center text?

    Maybe this question has been asked before, but I have been trying to center a line of text with spaces, and am nearly about to pull my hair out.
    Is there any way to center a line of text?

    Are you writing a plugin to Acrobat in C/C++?
    If so, then you should start reading the documentation in the SDK about
    the various data structures and programming model for the SDK.  You can
    also look at the sample code as well.
    There are APIs there for doing all these things - you simply have to put
    them together in the right order...

  • How do I center text in Final cut Pro?

    Hi, does anyone know how to directly center text with more than one line of text in Final Cut Pro?
    If I have more than one line it doesn't seem to center properly. I've tried wireframe (which is inaccurate), center values (which doesn't work) and Boris 3D (which does the job but the space between letters isn't accurate so I need to try an alternative method).
    Any ideas?

    In Title 3D you use the Position X/Y button to adjust the height. The spacing between the letters in Title 3D can be adjusted both in tracking and in kerning by placing the cursor between a letter pair. Title 3D is perhaps one of the most accurate and precise text positioning titlers available in any software.

  • How can i get the content of JTextArea with out loosing Indentation.

    I am developing one mail sending application. I am getting mailid , from address, mail body from one Swing. In one JTextArea i am typing i have typed some matter. When i call the content of JTextArea using
    jtx.getText() method, i am getting all the content as one paragraph. That means there is no indentation which was there in TextArea.
    Please provide me some solution how can i get the content of JTextArea wiht out loosing indentation.

    And it was you who asked the question!

  • How can i print text messages from my htc amaze to my deskjet 3050A

    how can i print text messages from my htc amaze to my hp deskjet 3050A

    Hi,
    I believe the phone uses Android OS, v2.3.4 (Gingerbread) therefore you can use one of these applications:
       http://www.printeron.com/apps/androidprinting.html
       https://market.android.com/details?id=com.pauloslf​.cloudprint&hl=en
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How can I insert text in a photo?

    How can I insert text onto a photo?  Before Lion used Command T. Have not installed Page or Numbers. Have Microsoft for Mac.

    Open the photo with Preview and select ⌃⌘T.
    (Also, take a look at: Skitch)

  • How can I copy text from one card to another while creating cards using Iphoto?

    I created two cards with different pictures using Iphoto on Macnotebook. 
    I want to use the same text message.
    How can I copy text from one card to another?

    select the text and copy (edit menu ==> copy) tehn gpo to the next card and paste
    LN

  • How can I output text in a browser window in JAVA?

    How can I output text in a browser window in JAVA?

    "response.getWriter().print()" is the most common method when using servlets

  • How can I wrap text in a pie in pages?

    How can I wrap text in a pie in pages?

    If you need to insert text into a shape like a pie wedge, the easiest way might be to simply use the shape - freeform tool (at the bottom of the shape menu) and create a shape and type your text in it then place the shape over your pie wedge. The text within the shape should wrap - additional controls for text can be used with the Text Inspector.
    You can edit the actual shape with Format Object > Make Shape Editable option but unfortunately, you have an option to make straight or smooth curves, but not both, so you'll need to shape the object using smooth curves and use the the bezier controls that appear as you select a control point.

  • How can I save text messages to my Mac and will that reduce "Other" in storage?

    I have hundreds (or more) of text messages on my iPhone 5 that for personal reasons, I want to save. There are far too many to do screenshots. I want to save them to my MacBook Pro Retina in a readable and printable format. The reason is that I read that text messages can cause the "Other" storage to be higher. My "Other" is over 6 GB on a 16 GB iphone. Therefore I want to save texts, print them, and delete from phone.
    First question: Is it true that text messages contribute to the size of "Other"?
    Second question: How can I save texts to Mac in readable format so they could be printed? 
    Third question: How in the world do I delete all these texts from my iPhone efficiently? Is there a way to "mass delete"?
    When you are answering this, perhaps it is noteworthy that:
    (a) I've had an iPhone since a 3G in 2009, and the texts I want to save have been accumulating since then.
    (b) My "Other" has gradually gotten larger over the years. 
    (c)  I sync with itunes regularly.
    (d) I've never had any problems with an iphone or with my data.
    (e) I've restored from backup only three times, when I upgraded to the iphone 4, 4S, and 5.
    I want to get this "Other" cleared up before I upgrade to the iphone 5S. 
    Thank you.

    You can select to export a folder to save as a .mbox file. This file would need to be imported if you wanted to view the messages.
    Select mailbox (folder)
    Under Mailbox in the Menu bar select Export Mailbox...
    You might also want to check out the demo for EagleFiler by the author for SpamSieve. You could view and search the messages archived in EagleFiler.
    http://c-command.com/eaglefiler/
    Regarding Mail being slow....
    Is it only Mail that is slow?  How much free space on your drive? Use Disk Utility to find available space.

  • How can i use text expander with the new Mavericks,

    how can i use text expander with the new Mavericks,

    I regret upgrading to mavericks for the same reason
    ftamez wrote:
    how can i use text expander with the new Mavericks,
    Now I have been searching - and you have to buy an app and it will cost you $34.99 (what a rip off)

  • How can i print text message from my iPhone?

    I have an iPhone 5S.  How can I print text messages to save those conversations?

    Did you try to copy and paste the content into another app, like notes or Mail and then send it to the printer?

  • How can I edit text tabs in Photoshop...?

    how can I edit text tabs in Photoshop like in Illustrator that I can choose to view the tab rulers and edit the alignment on the tabs?
    is it possible? otherwise I can't understand why I can use the tabs at all...
    thanks!

    No, tab-formatted text is not editable in the manner you desire. As for your question - tab is just a character like any other. You are simply taking a given kind of implementation for granted, nothing more, but that must not necessarily be the case for all programs. An evil programmer just could assign the tab key to forward delete or any other fancy function just as he could make your space key draw funky symbols from a different Unicode range, if you get my meaning... so simply take it the way it is. If editable formatting is high on your wishlist:
    http://www.adobe.com/go/wish
    Mylenium

Maybe you are looking for