Color only certain text in TextArea

Hello, I'm making an applet and I'm writing my output to a TextArea. I was wondering if it is possible to color only certain text. I.E. have some text in black and some in red.
I know you can color all text using foreground, but wasn't too sure if you could color certain text.
Any helps appreciated. Thank you in advance.

corlettk wrote:
Carn Doc, Give us a hint... It'd be a decendant of TextArea which has-a HtmlDocument, wouldn't it? But what's it called?Nope.
The Java™ Tutorials: [Using Text Components|http://java.sun.com/docs/books/tutorial/uiswing/components/text.html]
The inheritance tree near the top of the page should be enough :-)
db

Similar Messages

  • [b]How to Set Color of certain text in textArea.append();?[/b]

    Hiya guys
    Could anyone give me some advise on the easiest possible way to set certain text 1 color and other text a different color when appending a string to a textarea.
    Thanks in advanced!

    You can't. Use a JTextPane:
    http://forum.java.sun.com/thread.jspa?forumID=57&messageID=1408602

  • When I receive calls I always get the option to remind me later, but only certain times I get the option to respond with text.  Is there a setting I need to update to always get this option?

    When I receive calls I always get the option to remind me later, but only certain times I get the option to respond with text.  Is there a setting I need to update to always get this option?  Also i can't use location reminders.  Is this because my calendar is in Outlook?

    The only known way to make it work on an external drive is by first installing Windows onto an internal drive, then cloning the install to an external Thunderbolt drive. Thunderbolt is seen as an extension of the internal bus, so Windows doesn't see it as an external device.

  • Share only certain properties across pages

    Is it possible to share only certain properties of an object across other pages?
    For example, I have a text heading on each my pages. It's in the same place and same color on every page. The actual text differs though on every page (e.g. one page says Home, another says About, etc.). Is it possible to share it the color and location across other pages, but not the actual text value?

    You can "cheat" this by converting one of the text objects to a button symbol. Button symbols allow for different text labels for each instance. I do this all the time. Use this symbol on all your pages, and update the label in the Properties panel.
    One trick though, make sure you ad an identical Over state to the button symbol, otherwise if you preview or export an HTML prototype, the text will disappear if you mouse over it.
    Jim Babbage
    http://www.peachpit.com/store/product.aspx?isbn=0321562879

  • 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 do I change the colors of Ring texts individually so when it pulls down, I can see each test with different background color?

    I have been using LabView for a almost 18 months now. There was no problem which I could not solve with help of all resources available. But, this is one where I am scratching my head since long time now.
    I would like to change colors of each individual text in Ring control programmatically. I have attached example VI. In this VI, I change background color of ring text, but it changes only the current (active) background color, so when you pull down the whole menu, it shows same default color for all the text background (not even the color I asked it to). Is there anyway I can define individually as to what color should be related to each text in ring menu?
    Attachments:
    Ring Menu Colors.JPG ‏16 KB
    RGB Ring.vi ‏33 KB

    " Is there anyway I can define individually as to what color should be related to each text in ring menu?"
    Well not with a ring and not programatically.
    The best I can suggest is a picture ring, see below.
    Ben
    Message Edited by Ben on 11-18-2005 02:16 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Picture Ring.JPG ‏5 KB

  • Numbers not displaying certain text.

    I use Numbers to create invoices. Previous versions of numbers would display and print but not export certain text. In version 9 the same text will not even display. Any way to fix without opening all my old invoices in a previous version of Numbers?

    Can you be more specific as to what is not displaying or printing or exporting?
    Which version are you using. I ask because you said "previous versions would..." which implies Numbers '08 and Numbers '09, the only two previous versions. From that, and your profile of OS X 10.9.1, I would assume your question is about Numbers 3.  But then you made a statement about Numbers "9" as the version you are having the problem with.
    What are you exporting to? Excel, CSV, PDF?
    Maybe a screenshot would help?

  • Changing colors ONLY

    OK, I have the menu done, and now I want to play with the colors of the individual menu Items.
    Right now they are Greenish. I have a Paragraph style (and Object styles, calling the Para styles) with Green specified as the color.
    What I want to do, is simply go out to all the text frames and change in one click all the green colors to (for example) Blue.
    But the formatting changes when I do this so I am not sure what I am doing wrong.
    Any suggestions would be appreciated.
    Bob
    edited comment added. I think I see what is getting me. In the Changing Colors Paragraph Style, it sets the Font and Point. How do I get a style to just change the color and color only (leaving any formatting untouched)?

    If you already have a style applied to this text, the simple thing to do is edit that style to change the color.
    You could make a new style based on the other, changing only the color, but it would take longer to apply. Editing an existing style is an instantaneous way to make changes through the whole document in a single operation -- that's one of the big reasons why you use them.

  • A quick way to set different color for certain items in JList?

    is there a quick way of setting different color for certain items in JList?

    Either use HTML strings as the values in your JList (quickest, but may not be the most convenient, especially if your model isn't just text), or create your own ListCellRenderer (e.g. extend DefaultListCellRenderer).
    There is no such thing as "list.setItemForeground(int index, Color c)". You'll have to use one of the methods above.

  • Having several problems with Adobe Premiere Elements 13.  Right now my worst is that when I add text to a clip, it goes out of "auto color" while the text is up.  Help?

    I'm having a number of problems with Elements 13.  One is that, while in "play" mode, the sound will just stop happening.  I have to click "pause" then "go" again and the sound comes back.  It also stops playing on it's own, I have to hit "play" repeatedly.  Just got the software, have been using it extensively for a week or two, and this just started happening.dor
    Now today, when I add text to a clip, it drops out of "auto color" while the text is visible in the clip, then back into auto color when the text is gone.  Any suggestiosn?

    nikovichb
    If we are looking at the same thing, you have called attention to one strange Premiere Elements 13 AutoColor/Titler interaction. This can be reproduced in the Expert or
    the Quick workspace. I will demo this in the Quick workspace since that is where you have been working.
    1. Import a still into the Quick workspace/Filmstrip.
    2. With the still selected, go to Adjust Tab/Adjustments Palette/Color Panel expanded and just click on the Auto Color Tab. Close the Adjust Tab route.
    3. Go to Text Menu/New Text/Default Text to open the project's Titler. When you do that you see the following and not the still over which the text title is to go.
    And when you close the Titler, you then see the "Add Text" text title in the still.
    The only solution that I can think of at this time is to create the text title and then apply the Auto Color to the still.
    It is interesting that this only happens with the Auto Color in the Color Panel selected. If you do not click on
    Color Panel and use the More options for Color adjustments, this behavior does not take place.
    Deletion of Adobe Premiere Elements Prefs file does not correct this situation.
    As for
    I'm having a number of problems with Elements 13.  One is that, while in "play" mode, the sound will just stop happening.  I have to click "pause" then "go" again and the sound comes back.  It also stops playing on it's own, I have to hit "play" repeatedly.  Just got the software, have been using it extensively for a week or two, and this just started happening.dor
    I think that here we need to explore project settings (project presets), properties of source media, and Timeline rendered and unrendered content prior to export.
    Please review the above
    a. verify if the Auto Color Text Title glitch that I saw is what you described in your situation
    b. give the details of your project so that we can explore cause and effect for Timeline content playback irregularities as seen in the Edit area monitor.
    Thanks.
    ATR

  • Labels are still garish-color entire titles, text.

    Hi. I thought by now Apple would have modified or provided options for coloring only an icon or folder, and not the entire line of text.
    I have used unsanity software's Labels X for just that reason. Sadly, they have not updated to work in Lion.
    So, to my surprise and disappointment, after upgrading to Lion all my previously subtle and unobtrusive colored icons have become a wall of garish blocks of color. In folders where I may have several files or other folders labeled using Labels X, which only colored the icon not the text, I now see distracting rows of one color or another making my open windows and folders look like children's party decorations.
    Does anyone know of an alternative, either within Lion or via a third party app (as Labels X was)?
    Thanks

    For those who might not understand what this is all about, Apple in earlier OSs designed the Finder to display either colored labels or colored icons in list view, among others. With the advent of Leopard, the new designers, hellbent on moving to drab, ugly, monochromatic stuff, went for dismissing the colored icons option and foisted this on everyone. The original Apple design team had the right stuff, the new one, ugly garishness for its own sake; This screenshot depicts what Labels X restored, but which Apple crippled in Lion/ML so Unsanity couldn't move that haxie beyond Snow Leopard. One reason that I continue to do most of my work in SL.

  • Assign certain color to certain part  of body CS3 !

    Dear Friends !!
    Here is a little challenging question for some , it might be nothing to some Pros , but to us ordinary editors means a lot !
    Let's say I have a chroma (Green screen)  footage , which contain a simple girl standing in front of green screen acting .
    She is wearing red shirt , blue pants and black shoes in front of a green screen with decent lighting and make up.
    Now , even though she put good amount of make up on her face, but I still don't like the tone or color of her skin, her red shirt is red but not a rich red color as well as her blue pants is not rich blue, I mean a good blue or a nice blue !
    Is there any way to assign certain colors to certain part of her body, I mean let's say her face or skin tone, I wanna have it a little more natural (just the skin) I don't wanna change the color of her hair or clothing !
    and then goto hair and make the hair look more black , without touching her face and her clothing color and ect !

    Either RGB Curves (my personal preference for color correcting) or the Three-Way Color Corrector will allow you to isolate specific luminance (brightness) and chrominance (color) ranges to a certain degree, so that you can affect only the values that you want to adjust. It may take multiple copies of an effect, each working on certain colors or ranges of colors, to get the output you want, but it should be doable.
    Note that this will take a lot of tweaking and work, but if you've never experimented with color correction before, there's no time like the present!

  • Why this error message with certain texts?

    Why do i get this error message only with certain texts?  I have entered only a ten digit number, have deleted conversations and resent messages and still?

    Oh, the error message is "
    error invalid number please re-send using valid 10 digit mobile number or valid short code."

  • Need to apply table fill color based on text content

    Totally new to Indesign-scripting – but really need a solution to this:
    I have a table
    I want to fill the table cell with a different color based on text content.
    If cell contents the text "Apple" fill color of cell should be color swatch "Red"
    If cell contents the text "Banana" fill color of cell should be color swatch "Yellow"
    Any help most appriciated!

    Hi Franke,
    Try the below code, may it will helpful:
    var myDoc = app.activeDocument
    //var myCell = app.activeDocument.textFrames.everyItem().tables.everyItem().cells.everyItem().getElement s()
    app.findTextPreferences = app.changeTextPreferences = null
    app.findTextPreferences.findWhat = "Apple"
    var myFound = myDoc.findText()
    for(i=0; i<myFound.length; i++)
        if(myFound[i].parent.constructor.name == "Cell")
        myFound[i].parent.fillColor = "aaa"
    If the above code helps you, then please give Helpful or Correct Answers.
    Because for the last 3 months only I started my Indesign Scripting Career.
    With the help of Forum legends I can able to reply for simple questions.
    Thanks all...
    Regards
    BEGINNER

  • Colored highlighting of text

    Hello everybody. I'm a relative noob with ActionScript, and
    often the solutions I come up with are needlesly complicated due to
    me not being aware of a simpler solution. So before I embark I'd
    just like to bounce this off of anybody. Any feedback is most
    appreciated.
    I want a paragraph of text to become "highlightable" with
    highlighter markers (dragable movie clips), 4 colors in all. I know
    the background color of a text box can be set, but in this case I
    want sentences, individual words, etc. to be able to have their
    background color change. I was thinking that I'd have to convert
    the text to paths, change each word to a movie clip and then script
    a behavior so each word movie clip changes color when a marker
    makes contact with them. This seems like iti will be a very tedious
    process, but at this moment it's the only strategy I've come up
    with.
    Any alternative solutions?

    Sorry for the delayed reponse regarding this, hard to find
    time to work on this problem. So how do you specify an individual
    word in a text box to have the color, font, whatever changed when
    the user clicks/selects that word. I understand how to set the text
    format after reading up on it a bit, but still unsure what event
    would trigger one word to change it's format.
    Any advice is most welcome.

Maybe you are looking for