Changing colour of certain words/lines in JEditorPane

Hi,
Is there any way to change the colour of only certain lines/words/phrases etc in a JEditorPane without having to add HTML or anything to the file? I've never used any of the editor kits, so I might be misinterpreting them, but isn't it the case that I would have to add extra data to the file in order to display the different coloured text? All I want is for the user to be able to open a text file and then parse it looking for certain phrases and if they're there every one gets highlighted in red or blue or something, just like keywords are highlighted in blue and comments in green in Eclipse. Can I do this?
Cheers everyone.

Using these principles... I'm setting character attributes in a JTextPane using getStyledDocument().setCharacterAttributes() ... I'm providing it with a Style object which specifies the attributes, but when I say getCharacterAttributes() it returns some stupid LeafElement, which can't be cast to Style. I need a Style object, or something very similar, so that I can use it properly. Does anyone know how to get the style, or list of styles, that is operational at the selected indices?
Thanks

Similar Messages

  • Changing colour of Available capacity Line Graph in DIMSPPB_BARCHART_DEMO5

    Hi all experts,
    I am facing a problem in changing the colour of Available capacity Line Graph in program DIMSPPB_BARCHART_DEMO5. Currently it appears as a blue line. Can someone please help me in changing the colour of this graph to any colour I want.
    Thanks in advance,
    Mitrajit Debroy

  • Change colour font for active line in clearing transaction

    Hello,
    Our system is SAP ECC 6.0 with SAP GUI 710. When the signature design is activated, we have a problem of colour contrast between active/desactive lines in the transaction for clearing document (F-32 for example) : the active line is in dark blue and the inactive is in black. So it is difficult for several users to clearly see the difference between the active/desactive lines and they must choose the previous design (Enjoy or classic design). In fact, in classical desing is the active/desactive line in red/black or in the enjoy in Electrical bleu/black.
    I will add that it is not possible to change the colour theme in the design options in our configuration (perhaps is something missing ?).
    Does someone know if there is a possibility to change the colour policy ?
    I thank you in advance for your help.
    Céline

    up !!

  • Create document to change colour of certain graphics using own colour palette

    I want to create a flash document that allows me to change the colous of an image using a colour palette of my own. I am a complete beginner and have no idea where to start this, hence i would need to know what to do and how to do it.
    I basically want the image to be a simple 2d image that i will create using different layers in photoshop and import them into flash, the layer images will all be one colour so the colour of the whole layer changes.
    so the colour palette will be on the side of this and when i click on an image and then a colour the image changes to the colour i clicked.
    I know how i have explained this is a bit hard to understanbd but any help is greatly appreciated.
    Thank You

    the document is not for me to use but for me to give to a large group of peopleand they will themselves select their own colours, i want to be able to intergrate my own colour palette into it which will have hundereds of colours....very similar to a room planner kind of thing, where you select a colour and the object you selected changes to that colour, but i need it for somthing else.

  • How do you change the click box properties (line colour and width) in Captivate 7.0?

    How do you change the click box properties (line colour and width) in Captivate 7.0?

    Yes certainly, we can do that, insert a smart shape and use it as a button, then go to the properties pane, change the Alpha to 0, that will make it transparent, and add the stroke color as red and increase the width.
    In case of a button, you have to select button type as transparent and do the same.
    Thanks.

  • Change the colour of the outer line of a circle

    Hello everyone,
    I drew up a circle with no fill inside, to show where the location of my highway storm culvert will be.
    I changed the thickness of the outer line of my circle shape by creating a stroke effect at layer → blending options → stroke; then I changed the thickness of the line by right clicking in stroke at the layers panel and then choosing "scale effect."
    But the problem I have is that the outer line is gray, and I want it to be black.
    The outer line was originally red though so I changed my image → mode to grayscale, because I couldn't find a way to change the colour while keeping my image in RGB colour.  So I've managed to make the outer line gray by changing the image mode but I still can't change the colour of the outer line to black.
    I'm sure there must be other ways of changing the outer line colour without having to change the image mode, but I'm clueless.
    Here is my drawing:
    The text next to the circle says «Obra de desagüe». That's spanish for "drainage construction site."
    You see, I can't change the colour because I have no clue at where the "change colour option" is. I tried going to layer → layer properties, but in there there's only 7 colours to choose from. I chose a random colour, just to see what happens and what truly changed colour was the layer, within the layers panel; not the shape contained within the layer.
    So I'm lost here, any help please?
    Unfortunately I'm still not an expert in Photoshop just yet.
    Thank you for reading my post.

    Set shape layer opacity 100% Fill 0% to make fill transparent or add an empty layer make a circular selection stroke it black.

  • Can I prevent certain words from being hyphenated or split?

    I have a client that is real picky about the title of their business which is 2 words from being separated with the first word on one line and the next word on the line below.  There are other times like names of people that will get hyphenated and they dont want that either.  I know I can turn off all hyphens but I still want them, just not with certain words.  Is there a way to control both of these?

    Hello,
    Just to throw in another option, I sometimes do this through find and change.
    I just type the word in the Find what field that I don't want to hyphenate,  and then I go to the change format area on the bottom of the dialog box and click the no break check box in the basic character formats area,  and then I change all in the document.
    Hope that helps too..
    babs

  • How do I stop text from changing colour when hovering over it?

    Hello, I have downloaded a template for Dream Weaver CS6 (Which is the version i am usig). When you hover over one of the boxes the top text changes colour to black instead of staying white... does any one know how i can make it so the text stays the same colour. I will post a print screen of it.
    Before clicking:
    View image: 1
    When hovering over it:
    http://postimg.org/image/wdsii9mab/
    I will post the code of the index page aswell: <!DOCTYPE html> <html lang="en"> <head> <title>Home</title> <meta ch - Pastebin.com
    Any help is appreciated. Thanks.

    Your unwanted pink hover color comes from style.css line 181 here
    .btn_{
        background: none repeat scroll 0 0 #cf3046;    border: medium none;
        border-radius: 3px;
        box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
        color: #ffffff;
        font-family: "Open Sans",sans-serif;
        font-size: 12px;
        font-weight: bold;
        line-height: 15px;
        margin-top: 20px;
        padding: 7px 13px 8px;
        text-decoration: none;
        text-shadow: none;
        text-transform: uppercase;

  • I just downloaded Pages. When typing on a blank document, I am unable to highlight certain words.  My daughter usesbitbfor homework and needs to highlight her spelling words.  I've read disucssions and it says gonto the a and enter fill and cg

    I just started using Pages and am trying to figure out how I can highlight certain words in sentences.  I have read some of the discussions and they have said to go to the "a" on the top bar.  When using a blank document, the letter "a" doesn't show up and there isn't an option to fill in or use shadowing.  Help!

    At the top of the screen in Page there is an "I" next to the Media Icon. If you tap that "I" icon - you bring up a menu that has Style as one of the options. Tap Style and you can change the color of the text and use all of the preinstalled Styles available in the app.
    If you swipe all the way to the bottom of the Styles menu- there is a Text Options listed. Tap on that and you can select different sizes, fonts, and text colors.

  • Siri won't recognize certain words

    I tried to create a reminder today for a Parents evening I had to attend .
    I used Siri as usual and when asked what the reminder was for I said "parents evening". The two words came up but the reminder just said "parents"
    I tried it again and the same happened so I tried "Parents Night" but the same thing happened.I then tried to just create a reminder for "evening" The word came up but Siri asked  what I wanted to be reminded about again so I tried "night" and the same thing happened. I have tried on a 5s and a 6 both running the latest IOS anyone got any answers ?.Is there certain words you can't use

    Reminders uses data detectors to automatically convert text, or speech via Siri, that refers to date and time into a scheduled date and time (i.e. Today, 6:00 PM). There is no option to turn data detectors off.
    However, you can use a word that they do recognize to schedule a time of day after the word "evening". Depending upon the time of day the reminder is made it will either be scheduled for today, or tomorrow if the time of day has already passed.
    Spoken lines and the results:
    remember parents evening morning
    Parents evening
    Today, 7:00 AM
    remember parents evening noon
    Parents evening
    Today, 12:00 PM
    remember parents evening evening
    Parents evening
    Today, 6:00 PM
    remember parents evening night
    Parents evening
    Today, 7:00 PM
    remember parents evening midnight
    Parents evening
    Tomorrow, 12:00 AM
    Apple Data Detectors

  • Changing colour of people

    Hi. This might be a little difficult to explain.
    I want to change the colour of certain people's faces in FCP 5. Just their faces, possibly their bodies as well, but not the entire frame. The story i'm working on involved on character seeing others in different shades of blue. How would i be able to make certain character's faces have a blue tint? Each shot i want to do this for would only be a couple of seconds long. Can i do this in photoshop? I also have after effects 6 but i have no idea how to use it.
    Many thanks for your help.
    daniel.

    Hi Daniel,
    I've had luck with the "Proc Amp" filter (under Image Control). Apply it twice, one on top of the other, and play with the Hues. It was years ago so I don't remember the exact values I used, but I got Blue faces with very little change to the other colours in the frame.
    There are of course more complex ways to do this with other app's, etc., but it looks like you're looking for a quick fix. Maybe you can take this and build on it.
    Joni

  • Match Certain word in a String

    Hi all,
    I'm actually doing a project regrading e-learning. And i'm suppose to create a set of questions for each topics using labview. So Is there any way that i can match certain word in the string to make sure that answer is correct? Cause i'm sure that every user that input answer will be different. Thus, I want to pick out main point as an answer. Is there anyway i can do it?? 
    Really appreciate your help!!! 
    Thank you!! 
    Solved!
    Go to Solution.
    Attachments:
    Match Strings.vi ‏8 KB
    Match Strings.vi ‏8 KB

    Here's another option (building on Jeff's code).  Turn on the Conditional Terminal on the FOR loop and change it to "Continue if TRUE".  This way, the loop will exit as soon as a failure is found.  Just pass the result straight out of the loop.  If none fail, then the FOR loop will exit on its own (from the auto-indexing) and a pass is passed out.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Match String.png ‏19 KB

  • Lightroom changes colour in my RAW files captured with NIKON D300

    Dear All! Lightroom changes colour in my RAW files captured with NIKON D300. Some of the images are completely ruined. I am sure Adobe must be aware of this problem. What could be done? Is there a solution? Many thanks for your help. Regards, Stanislav

    You want "something different" but this "something different" is quite hard to define.
    I want a result which reflects the result on the camera. Have the feeling the display
    of the D800 is not the greatest, at least (not only the color issue which is often discussed)
    but also the exposure. Often I think I would need to compensate it, but then afterwards
    on the computer the non corrected version looks most of the time better.
    I think its interesting to see how allergic people react when the word jpeg comes up.
    This is also just a rendered result, just by the camera. There are many options in my cam.
    I like the vivid setting with some modifications. And that gives me a result I like.
    And if I like the result, why shall I spend way more time to replicate it?
    I do not talk about that I would want the jpeg, I only say that what I get color wise out of the
    box is how I would like to look at it. I still want the capability to fix for example exposure  in image,
    but I want the base the version I got from the jpeg view (or how the Nikon raw software could do).
    On Lightroom I did not manage to have a profile that looked as appealing to me.
    It also consumes way more time in my workflow to fix all pictures manually and results might differ.
    To work on an image you need a starting point, I do not say the jpeg look is always perfect and
    what I want all the time, but most of the time it is.
    You say yourself you use profiles. So why should there not be a profile which automatically adjusts to the camera settings.
    Its so frustrating to see a look which you like (the preview image when the pic is first accessed) and
    then Lightroom switches to its own rendering which is flat and which I do not like.
    For me its clearly something Adobe and/or Nikon should fix, like the mentioned "auto correct to preview look",
    Nikon profiles/settings/raw-details in Lightroom or for example a Nikon import module.

  • Latest update messes up colours in certain windowed applications.

    Hello there, a couple of days ago (April 16th) I installed the latest updates available for my system. This included:
    Safari 5.0.5
    Security Update 2011-002 1.0
    Canon Printer Software Update 2.5
    The installation went as planned, but shortly thereafter I started noticing colours that weren't there usual vibrant selves. They were washed out, and tinged with brown. The first thing i check was my colour profile, it was as it should be. Upon further inspection I realized it was only affecting the colours in certain windowed apps. For example, in Adobe Bridge CS5, thumbnails of my work appeared washed out and brown, but if i view the full screen preview, the colours are as beautiful as they should be. Another example, websites appear washed out and brown in the browser (I've only tested in Chrome so far), but when I take a screen shot, then press the space bar to view the screenshot, the colours in the screen shot are vibrant as i expect them to be. However if I open the screenshot in preview, the colours are incorrect.
    I also installed the same updates on my MacBook Pro, and haven't noticed any problems.
    So what's going on here then?
    Cheers.

    Since changing my screen arrangement so my dock is on the main screen again, I've noticed that the icons in the app folder are all horribly oversaturated.
    Please help me Apple, I like my colours to be correct. Microsoft always managed to get it right for a much lower price, so I'm sure you can manage too

  • I have iMove 11 and photos turn very dark when I drag  them into the project. Changing colour white balance does not fix the problem.

    I have iMove 11 and photos turn very dark when I drag  them into the project. Changing colour white balance does not fix the problem.

    Thanks for your no help line.

Maybe you are looking for