Change the font of part of a JTextArea

Hi,
I would like to know if it is possible to change the font of part of a JTextArea, because the setFont method changes the entire text.

As per the [Sun text component tutorial|http://java.sun.com/docs/books/tutorial/uiswing/components/text.html]:
JTextArea can display multiple lines of editable text. Although a text area can display text in any font, all of the text is in the same font. Use a text area to allow the user to enter unformatted text of any length or to display unformatted help information.
To achieve your goal, you may need to look into using another text component such as a JEditorPane or JTextPane. I recommend that you have a look at the tutorial linked above.

Similar Messages

  • How can one edit a .gif file graphics background and change the fonts in Photoshop Elements 13?

    I am trying to change the color and fonts of some of my web sites .gif files. Can I change the color to another hexadecimal color and change the fonts of the letters in Photoshop 13? I am using Windows 7 and heard that you could save the .gif file to another format, edit it, then change the file back to a .gif file. Is this true? If so, how do you do it? The file just has a solid color with the letters "Firm " on it. No animation.

    You can edit a gif without changing the format, but once you save the file as a gif the text becomes part of the image, not text anymore, so you would need to clone or heal away the existing text and then create a new text layer and use save for web to create a new gif.
    For access to the most editing tools, while the file is open in the editor go to image>mode and change it from index color to RGB. Saving as a gif will change it back to index mode.

  • How can I change the font size on the post of WordPress?

    I have found three websites which address WordPress style sheets:
    Playing With Fonts: http://codex.wordpress.org/Playing_With_…
    Font Size and Color: http://en.support.wordpress.com/editors/…
    How to Change Font Size In Wordpress: http://www.ehow.com/how_5469172_change-f…
    Here are the instructions from the third website above:
    Things You'll Need:
    Site designed in Wordpress
    Administrator access
    Step 1
    First, to change the font size on a Wordpress site you need to log into the site as administrator. If you do not know how to reach the login page, simply add "/wp-login.php" after the "www.url.com" address. Then login using the admin sign in.
    Step 2
    Next, get to the Wordpress file editor by going to Appearance->Editor.
    Step 3
    Once in Editor, identify the Stylesheet file (style.css) and click to edit. This is usually located on the right hand side under the "Styles" heading.
    Step 4
    Once in the style.css file, you want to conduct a search for "fontsize". This parameter is used throughout the style.css file and is the parameter used to control font size. Next to "fontsize" you will see something like "16px". Simply increase or decrease the "16" to change font size. The tricky part is to figure out which "fontsize" you want to edit.
    The way to do this is to first look at the heading it is under. If it is under "comment-template", it is obviously related to either the font size of the comments themselves or perhaps the comment form or the date/time stamp of the comment.
    It may take a little trial and error to find the right "fontsize" to modify. Simply modify the one you think is correct and in a separate window, reload the page with the font you are looking to modify. If it did not change, undo the previous edit and try a different "fontsize".
    I went to the Dashboard and clicked on the “Appearance” icon on the left-hand side, and then clicked on editor. I clicked on Stylesheet (style.css), but I have not been able to find the “fontsize” that would change my post font size. As the author writes: "The tricky part is to figure out which "fontsize" you want to edit." Some of the font sizes are given as a percentage, and I don’t know if these come into question, i.e., if I should try changing one of these to see what happens.
    The end result is that I still have not been able to change my post font size, other than by using the Heading-1-through-6 option, which, I understand, is not the best way to do it.

    From John Waller: “If you're using IE8, hit F12 to launch Developer Tools which give you a point and click method of locating the relevant CSS rule on screen.”
    I have Internet Explorer 8 (IE8) so tried this method.
    This sounded like another promising possibility; however, I have not been able to change the font size in my post using this method.
    I have gone to Dashboard > Posts > Edit > then moused-over my post > clicked on "edit" and then hit F12. An enormous amount (20 pages or more) of CSS appears. I tried picking out the font size that I thought pertains to the post (under Text Area), and I have changed the font size from 13px to 24px; however, I have not been able to “save” the new setting. When I go back to it, it is back to 13px.
    As a result, I have not been able to use a trial-and-error method to establish which font size I must change in order to change the font size of my post.

  • Where can I change the font settings for the name of the month in iPhoto's calendar project?

    where can I change the font settings for the name of the month in iPhoto's calendar project?  I just ordered two copies of a calendar I designed in iPhoto and was surprised to find that the calendar's months were printing in something like an Arial 10 pt font.  On previous calendars I've printer via iPhoto and Apple, the font was much larger.  I've tried every menu option in iPhoto and the Calendar Project program and can't find where this is modifyable. Which leads me to ask, what the heck happened here in the first place?  I did not consciously change the default.
    I do remember that I got some notice when I first tried to print the calendar about the default font having been changed, but I don't know how this could have happened, and I didn't know what impact that had on the calendar until it was delivered.  I typically print about a dozen annual calendars but won't buy another until I've got a handle on this problem.  For the most part, the rest of the calendar is okay.
    As a P.S. is there anywhere where one can get a power user's manual, or instruction on iPhoto?
    Message was edited by: KPAausFrankfort

    "Maximum" and "12" usually refer to compression (influencing image quality and jpeg file size in bytes); and as Curt wrote, dpi is meaningless for display by and viewing in web browsers.  (It could be a different matter if you are uploading the jpeg files for someone to download from the web to print.)
    What are the sequence of steps that you and your batch processing take from Bridge?
    You can use call Photoshop's Image Processor from Bridge to create the jpeg files  (Tools > Photoshop > Image Processor).  In the Image Processor you can set jpeg compression, pixel dimensions if desired, also convert to sRGB (good idea for web display).  In my experience the image processor leaves unchanged whatever dpi is set in the source file; or, if none there as might be for a pdf, it will set the dpi value in your New Document Preset Print Resolution (from your Photoshop Units & Rulers preferences).

  • How do I change the font size and color in a text box?

    How do I change the font size and color in a text box?

    Really frustrating to find the first time but simple once you figure it out. I think I spent hours trying to find this. Simply right click on a blank spot in the toolbar up top and select Properties Bar. There it is! The available properties will change depending on whether you have the content (text) selected or the box itself.
    I haven't found a way yet to make it show up as a regular part of the toolbar. It floats around and gets in the way so I don't leave it on and then have to open it again when I need it. Again - frustrating; but at least it's there!

  • How to change the font size of the string by using java?

    I wish to change the font size of the text, read from a text file by using java. Please send me the sample codes. By using ActiveX component for word we can do it. Please give me any other solution to suit the platform independ. Thanks in advance.
    thanks,
    Karthik.

    Text is displayed in some kind of text component - JTextField, JTextArea, JTextPane....To change the font of the text you change the font associated with the text component:
    textComponent.setFont( .... );

  • How to change the font in query builder window in Reports 6i?

    Hi
    I am facing the old problem again and again, which is I can not find any way to change the font in query builder window in Reports 6i. The current font is so bad for alignment and ordering each part of SELECT statement. Is there any way to change this to COURIER NEW for example?

    No, but I suggest using a different editor which does allow a different text option and just pasting it in.

  • How can I change the font size on the Mail program?

    How can I change the font size on the Mail program?  The text is quite small right now.

    Go to fonts and colors in Mail preferences and there you can change the font or size for the different parts of Mail.

  • How can I change the font size in the contacts win...

    I can change the font size in the Message window,  but the text that I type is too small for me to read, and I'm making a lot of typing mistakes.
    For the most part,  I need every font in Skype to be made larger.   I'm visually impaired,  and using skype is straining my eyes trying to read my skype messages.

    Sawry no can do.
    You can use control and 2 finger push to zoom if that helps.

  • Change the font of a selected text

    First of all sorry for my english because i'm spanish. I'm doing a simple text editor 100% compatible with all the web browsers. The editor must to have the option of change the font of a selected text. I don't know how to do this. Thank you.

    you should look at examples that are provided with swing package, there are some simple texteditors, and then of course you should start thinking in AWT to make your editor compatible with all browsers as you wanted...
    if you want to use TextArea in your editor then you must remember that in one textarea you can use only one Font at the time... as well as you may not use different colors for different parts of text, but with such textarea you may create thing like Notepad in windows.
    L.

  • On certain sites, some lines have the lower half missing. Changing the font or its size does not help. The error does not appear with Iceape or Chromium.

    On some sites certain lines appear with the bottom half missing, as if obliterated. Changing the font or its size does not help. The error does not appear with Iceape or Chromium.

    I looks that the whole line doesn't fit in the container, so the bottom part is cut off. The usual cause is that a font is used that takes more vertical space, so any increase or changes from the font in what the website prescribes can cause this issue. I've seen web pages that were even affected by changing the minimum font size from none to 1 (!). If you do not have the font installed that the website specifies then Firefox will fallback to another (default) font that may have different dimensions.

  • How can I change the font when creating an e-mail in Outlook's web-mail mode?

    I am new to Firefox. When I go to a web-mail server, I can click on sending a new message. While there, I cannot find any way to change the font, font size, or color of the text. All of these options were available in a toolbar at the top of the message window when I am using Internet Explorer 9 or IE8. I have looked through all of the help files provided by Firefox, and found nothing about changing fonts, etc.
    Thanks for trying to help

    Hi Jaime,
    Are you saying, you are getting junk characters in the email attachment? Then pls check the following. Since you want to send Japanese fonts, please pass language 'J' in both  objpack-obj_langu = '3' & doc_chng-obj_langu  = '3' instead of '3' please replace it with 'J'.
    Another thing which you may have to check is the SCOT device type. As I understand from my basis colleague, this may also affect your attachment fonts since the emails are sent through SCOT. Go to transaction SCOT-> Settings-> Device types for format conversion. Check whether wrong device type is defined for Japanese there. Hope this helps
    Regards,
    Gokul

  • Change the font color of a text field in a table by key-combination

    I want to change the font color of a text field in a table (single cell only) on pressing a key combination. Does anybody know how to do this.
    I have a lot of data in a table. During an evaluation of the data in a meeting I want to change the color of the text depending on the result of the meeting. (for example: High risk = CTRL+R makes the text red).
    I know how to change the color using a button, but I do not want to add a button after each cell. For this reason I would like to do it on a key combination that alway refers to the active cell.
    Many thanks for your help in advance.
    Marcel

    Hi,
    I don't think you can use the ctrl key like that as those shortcuts will be intercepted by Reader (ctrl-R toggles the ruler display on / off).  You also might have trouble updating the color while you still have focus on it.  You can use the shift key in a similar way, so if you only have lower case characters in the text fields then you can do something like;
    if (xfa.event.shift)
        switch (xfa.event.change)
            case "R":
                this.fontColor = "255,0,0";
                break;
            case "O":
                this.fontColor = "255,102,0";
                break;
            case "G":
                this.fontColor = "0,255,0";
                break;
        xfa.event.change = ""; // ignore character
    If you need uppercase characters maybe you can have one button to set "review mode" and test that on the if (xfa.event.shift) line.  But again it wont take effect until you have tabbed out of the field.
    Regards
    Bruce

  • How does one change the font size for folders and/or file lists in the Bookmarks Library?

    How does one change the font size for folders and/or file lists in the '''Bookmarks''' Library?
    Since the upgrade to version 9.0.1 of Firefox, the Bookmarks feature changes are confusing me. They seem to be confusing themselves as well. The list of bookmarks has changed. The font size is so small that my aging eyes cannot read it without fogging the screen with my breath. Some folders are out of alphabetical order (where I know they were previously good), and some are missing altogether (folders to which I frequently add references).
    As for missing or deranged files or folders, was there something that I should have done or now need to do to recover those after the upgrade (or before)?
    With regard to font size,
    1. there is no “Edit Bookmarks” or like option to edit the list in this version
    2. the “zoom” option in the “view” list of functions is greyed out when in “Show All Bookmarks” window
    3. expanding the browser window has no effect on font size
    4. “Preferences” settings for font size has no effect in that window either, including advanced settings
    5. “Help” offers none that I can find.
    Can any of you Help?!?

    Maybe this extension helps:
    *Theme Font & Size Changer: https://addons.mozilla.org/firefox/addon/theme-font-size-changer/

  • In portal branding change the font colour of the popup dialog box

    hi all,
    I created  a theme of mine and changed the portal body colour to a dark shade. The porblem i am facing is..whn i click on the "Logout" button of the portal,it displays a popupbox saying "Are you sure you want to logg off?"...i want to change the font color to white as it is black in clour and not reaadable in the dark background colour.......can somebody help me in this ..
    Awaiting for your response..

    Hi.
    First solution is customizing logoffConfirmMsg.jsp (com.sap.portal.navigation.masthead.par) for your personal needs, but some coding is required.
    Second solution:
    1. adjust the color property of class .ctrlTxtStd in ctr_ie6.css and/or ctrl_nn7.css files from your theme:
    .ctrlTxtStd {
                color:#ffffff;
                font-family:Arial,Helvetica,sans-serif;
                font-size:0.7em;
                font-style:normal;
                font-weight:normal;
    2. If you edit css files directly on portal's file system, the restart of portal will be required.
    3.After portal or your theme updates repeat steps 1 and 2.

Maybe you are looking for

  • How to set PDF version for the output file in ES4

    I am using LiveCycle ES4 for converting word docs to PDF. In our client we invoke createPDF method of GeneratePdfServiceClient class. We are using a custom PDF setting in LiveCycle in which we have defined configuration as per the business requiremen

  • Error while creating material cost estimate

    Hello All I am creating material cost estimate of FG whose components are SF & ROH-2. While creating cost estimate system gives an error message which states: : *No cost element segment exists for 40103110 on 01.09.2009 Message no. CK048 Diagnosis Th

  • OID filter to restrict ocs user in calendar, files, mail

    We are trying to setup some filter in OID in order to restrict some search screen and list of value in calendar, mail and files so that our users doesn't see the users under another subtree of OID. We have the following in OID: orcldefaultsubscriber:

  • Focus cursor on field/reposition

    A BSP has been build with a large number of fields. To fill out the bottom fields the user has to scroll down. As a consequence you also have to scroll down every time the page is rendered (e.g. clicking on tableview on lower part of BSP) in order to

  • User has issues with SAP web protal

    HI Experts, Whenever I am trying to click on  Transaction Launcher ZPY0003 (Mines payslip) so that I can have direct access to R/3 HR system, the system is providing me the dump.It is showing the errors like Service cannot be reached & Internet Explo