Set color in TextArea for certain String

I need to highlight some Strings in different color than the setForeground() in the TextArea. Is it possible and how can I accomplish it?
Help is great appreciated.
Anna

I am able to use JTextPane to highlight certain string now.
Thanks a lot.
Though I am having problem on mouse double click on a file name.
For TextArea, the getSelectedText() will pick the full path name of the file. For JTextPane, the selected text is just part of the string.
Following is the text:
Test report is saved in file C:\tests\pf2150\JTAG\888_test.rpt
The file name is
C:\tests\pf2150\JTAG\888_test.rpt
My mouse is over the file name but double click only picks JTAG or pf2150 or ...
Could anybody help?
Anna

Similar Messages

  • How do I set color in IndexColorModel for Graphics

    I can't find a reasonable way to set the color so my test code is below:
    The IndexColorModel, BufferedImage, and Graphics2D construction is:
    IndexColorModel icm4=new IndexColorModel(4,16,r4,g4,b4);
    BufferedImage bi4=new
    BufferedImage(300,200,BufferedImage.TYPE_BYTE_BINARY,icm4);
    Graphics2D bi4g2=bi4.createGraphics(); where most of the rest of the code is:
    byte[]r4=new byte[] {000,(byte)255,(byte)000,(byte)000,(byte)255,(byte)255,(byte)000,(byte)255,(byte)255,(byte)255,(byte)100,(byte)150,(byte)200,(byte)255,(byte)000,(byte)000};
    byte[]g4=new byte[] {000,(byte)000,(byte)255,(byte)000,(byte)255,(byte)000,(byte)255,(byte)255,(byte)075,(byte)127,(byte)100,(byte)150,(byte)200,(byte)255,(byte)000,(byte)000};
    byte[]b4=new byte[] {000,(byte)000,(byte)000,(byte)255,(byte)000,(byte)255,(byte)255,(byte)255,(byte)000,(byte)127,(byte)100,(byte)150,(byte)200,(byte)175,(byte)000,(byte)000};
    bi4g2.setColor(Color.black);
    bi4g2.drawString("bi4g2.drawString black",20,10);
    bi4g2.setColor(Color.red  );
    bi4g2.drawString("bi4g2.drawString red",20,20);
    bi4g2.setColor(Color.green);
    bi4g2.drawString("bi4g2.drawString green",20,30);
    bi4g2.setColor(Color.blue );
    bi4g2.drawString("bi4g2.drawString blue",20,40);
    bi4g2.setColor(Color.cyan );
    bi4g2.drawString("bi4g2.drawString cyan",20,50);
    bi4g2.setColor(Color.gray );
    bi4g2.drawString("bi4g2.drawString gray",20,60);
    bi4g2.setColor(Color.pink );
    bi4g2.drawString("bi4g2.drawString pink",20,70);
    bi4g2.setColor(Color.white);
    bi4g2.drawString("bi4g2.drawString white",20,80);
    bi4g2.setColor(Color.orange);
    bi4g2.drawString("bi4g2.drawString orange",20,90);
    bi4g2.setColor(Color.yellow);
    bi4g2.drawString("bi4g2.drawString yellow",20,100);
    bi4g2.setColor(Color.magenta);
    bi4g2.drawString("bi4g2.drawString magenta",20,110);
    bi4g2.setColor(Color.darkGray);
    bi4g2.drawString("bi4g2.drawString darkGray",20,120);
    bi4g2.setColor(Color.lightGray);
    bi4g2.drawString("bi4g2.drawString lightGray",20,130); What is the correct way to set color?
    This doesn't work so well, but it sort of works.

    Are you talking about ePubs or iBook Author which is a similar but separate application.
    Pages doesn't have spreads, you have to construct the adjacent pages with each half of any textboxes or images on the left and right hand pages of a spread.
    Peter

  • Why does FCP set 30fps TC Rate for certain audio clips that lack TC stream?

    Hello folks,
    I'm cutting a DVCPRO HD 720p50 feature at 25fps on FCS2 w fcp 6.0.3. (Used a PAL Panasonic HVX200)
    When I import certain of the audio files from the location sound recordist, FCP lists the file as having a TC Rate of 30fps -- and puts a greenbar over my audio track in the 25fps timeline. the audio folks were not TC locked to the camera, so I'm in the midst of doing a manual post-sync (yeah, yeah) of all of these files and Merging them into new Master Clips (1V+6A) for editing.
    I already learned the great trick from this forum of importing the audio takes folders from each day and then disconnecting them to set them all as dual mono, then reimporting -- makes my Merge clips work the way I had hoped they would.
    But this 30fps/25fps issue is really holding me up. This phenomena of tracks mysteriously being picked as having a TC Rate of 30 is rare, like 50 of the 400 audio files, but I can find no way within FCP to correct this setting nor any indication why these files were chosen.
    I can't change the TC from 30-25 when a clip is online or offline -- I get the message "The media of one or more selected clips does not support the chosen timecode rate of 25, and are left untouched."
    Any help will be wildly appreciated -- I am eager to complete this sync project and get cutting!
    matt

    I got help for this issue over at CreativeCow's FCP pages -- it turns out, all I had to do was open a new project using an easy setting and project setting for vanilla PAL 25 fps SD stuff. All of the audio was correctly brought in -- then I disconnected all of the clips, made them dual mono, reconnected them, and copied them over to my old gristly project folder.
    Now I can marry these dual mono 25fps files to the video files without having FCP incorrectly compensate for "30fps" by speeding these clips up slightly, so things stay in sync.

  • Set message default format for certain recipients to SMS

    We travel a lot and always switch off data roaming.  Our children have iPhones and often send us messages.  These always default to iMessages. 
    However it can often be days before we can connect to the internet and then we get a batch of messages.  is it possible to set the default settings on the children's iPhonmes so that messages to mum and dad always go as SMS messages? We know they can resend the messages as text after they have gone as an iMessage but they tend to forget!!

    That means i still have to change the name for each attribute?
    Could it make it such that when the entity obejct is created, the name is already following as it is from the database? i.e some_column_name in the database will not become SomeColumnName in the entity object.

  • Tabular: set measure to blank() for certain dimensions

    Hi, I know there is no scope() equivalent in dax but i'm hoping there's some other combination of functions that will give me the same result
    I have a stock movement fact table and I have two running totals on it. One is is a 'stock to date' value while the other is a 'season to date' that resets to 0 at the start of each season (ie a custom YTD running total)
    The season to date value is created using a second date dim because the season start and end dates aren't static and change year to year.
    Here is the DAX for the season to date measure
    Season to Date:=[Sum Quantity](ALL(dimDate),
    FILTER(
    ALL(dimTransactionSeason),
    dimTransactionSeason[DayOfSeasonID]<=MAX(dimTransactionSeason[DayOfSeasonID])
    VALUES(dimTransactionSeason[TransactionSeasonID])
    I've set the date dim to be ignored, but that just means that the current season to date value is repeated. I'd rather the result be blank.
    Is there a dax function or combination of functions that will allow me to check whether the measure is being sliced by dimDate and replace it with BLANK()?
    I though i could use some kind of logic like countrows(dimdate)<>countrows(all(dimdate)) but i'm too new to DAX to figure this out by myself..
    Am I on the right track or is this not possible with tabular at the moment?
    thanks
    Jakub @ Adelaide, Australia

    Hi Jakub,
    In your scenario, you add a season to date measure to calculate the running total for each season, and now what you want to is that reset the measure to blank at the beginning of each season, right? Generally, the season start and end dates are static, so
    the running total aggregate automatically resets itself at the beginning of each season. In your scenario, what do you mean the season start and end dates aren't static and change year to year? Please refer to the link below which might helpful for you.
    Running Total Techniques in DAX
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Searching for certain string with wildcards

    Hi all,
      I am trying to find the characters  'GW' in material description with these examples:
      A)     (GW51) Metal spec round   --normally written this way
       B)     GW51) Metal spec round  -- typing error omit the left brackett
       C)     (GW51  Metal Spec round  --  typing error  omit the right brackett
       The codes works for A and C.
           FIND FIRST  OCCURENCE OF '(GW'  in material_desc.
       I am unable to use wildcards to find for GW*)  for B using FIND statement.
      Can anyone share with me using FIND for B ? 
    Thank you.
    Joyce

    use CP.
    if material_desc CP '*GW*'.
      write material_desc. " or do what ever you want.
    endif.

  • 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.

  • Search for certain Characters within set of Characters - in a field

    Hello -
    I know a search can be made within a field for a word, but I am not to sure, or I don't know how to accomplish this...To do a search in a field for certain characters within a larger set of charcters.
    For example: I would search, in the Call Description field, for DXXXX within CA0001DXXXXYYY or search for LXXXX within CA0001LXXXXYYY, the X is numeric characters and the Y's are Alpha characters. Can crystal accomplish this....
    Thanks for your gracious help....
    G.

    Like I said earlier, this code:
    If instr({database_field}, 'DXXXX') > 0 then "String Found" else "Not Found"
    cannot be used in a Record Selection formula.
    The following code can be used in the Record Selection formula:
    Instr({database field}, "string") > 0
    If you wish to search for 'D4444' in the field and return records where a match is found, you would use:
    Instr({database field}, "D4444") > 0
    -Abhilash

  • HT201299 Not enable or disable cellular data for certain iOS apps and features from setting? I keep it off but when I go to other app it on automatic

    I can't  enable or disable cellular data for certain iOS apps and features from  setting.
    When I off data for specific application and go to other option it automatic on all application
    Any one can help

    SOLUTION! (NO NEED TO RESET YOUR IPHONE SETTING!)
    I have the same issue for the last two weeks. But i have already managed to solve the issue all by myself. When i go to Settings > Cellular > below the tab "use cellular data for:", i turned off some apps which i didnt want to use with cellular data. As soon as i go back to Settings, and then i went back to Cellular, the apps which i had switched off earlier, automatically turned back on.
    Here's the solution:
    Either you're using wifi or cellular data, first of all you're gonna hafto turn on the cellular data use for App Store. Once you have turned it on, go to App Store application. Update ALL the apps which have new updates available. If it asks you to log in your App Store, just do so. If there's something wrong with your debit or credit card information, it will ask you to update to a different card. Just do what it asks. Put in a new credit or debit card info and fill in the forms provided. The card you're using must be usable and has usable balance in it. Let's say atleast $10 to $20. As soon as it confirms your card successfully, the app updates will start automatically. Continue to update all the apps. After all updates are finished, go back to Settings > Cellular. Try to switch on or off some apps for data use and recheck.
    Try it yourself! Have a nice day and don't put a blame on Apple for this.
    From Malaysia, with love.
    Please hit LIKE button if this solve your issue. Thank you very much! (:

  • Setting color codes for more than one photo at a time

    Is there any way to set color codes for more than one photo at a time?

    Hi John,
    I will look at keywords. My issue is speed. Right now I am culling and editing an event shoot that spanned a week with 35 separate events and more than 5000 images. So I use the fastest most convenient method I can and it still takes a long time to have a completed and final shoot. On this shoot I will end up with a final set of around 1500 images. Right now I am finishing processing a show that will hang in the Deutsches Amerikanish Zentrum in Stuttgart.
    As I am sure you are aware by now, having seen enough of my inane questions that over the last two years or since Lightroom version 1.xx if I could not figure out how to do something I skipped it. So many things in Lightroom are buried and unless you have a mind like a steel trap (and think that some of you guys in the forum do) locating how to do something is not obvious.
    For example, I only learned (in the last hour) that I could assign colors as a group of selections by using Shift + number. I found this in a side head in Martin Evenings Lightroom book. I still do not know how to find a way to display the color filter "selection" set in Library mode. Is there a way?
    To top it off, Stuttgart Media University asked me if I would add a Lightroom module to my schedule this year. Now I have a compelling reason to learn all those missing pieces that I have created workarounds for. Hence the number of posts you have been seeing from me over the past few of weeks.
    I tell my class that there are no such things as stupid questions, only questions. Now I am practicing what I have been preaching for the last gazillion years. Guys like you have been great.
    My workflow is
    1. I first separate all images by event. I do that at the time of import.
    2. I do a fast pass rejecting all the obviously bad images
    3. I do a second pass grouping the images by sub-group (speeches, people talking, performances, etc.) This is where I run out of selection methods and your key-wording could work but it would probably take too much time to establish a keyword set for a single event. Where I have more than five subgroups I set up different collection sets with one collection for each sub group. However I would like to keep a single event in one collection.
    4. I then select the images to be used by color code.
    5. Next I process the final images (crop develop etc) by collection.
    6. Last I output the set according to client requirement.
    If you have a better workflow, I am all ears.
    By the way, what is your photo specialty and where are you located?
    Jim

  • To set color for barchart having datetime column

    Hi,
       I have a datetime column in the XSD,
    I was trying to set colors for the barchart through,  chart expert --> colorhighlight  ,here in  colorhighlight when i click on new I am getting a dialogue box asking to enter datetime in M:D:YYYY H:MM:SS TT format. why is this dialogue displayed ? How to overcome this.
    Regards,
    Deepa V

    Hi Deepa
    Please inform us with the following information:
    1: What is the version of Crysatl Reports that you are using?
    2: What is the Chart Type that you are uisng?
    3: Where are you placing this chart in the report?
    Regards
    Ashwini Yadav

  • Set color for TableCellDesign for a table in readmode.

    My Requirement is dynamic assiging the Tabcelldesgin color for table column, but Table in readonly = false.
    is there any possiblity of assigining the values dunamically.
    Thanks in  advance

    Yes, i have assigned to Table column to set color dynamically for  different conditions.
    But color is visible, when table in read mode.
    My requirement is need to set color, when table in readonly = false.
    Please can any one have the solution for this>

  • How to set color for a tabstrip in BSP

    Hello all,
    Can anyone please let me know how to set color for a tabstripn in BSP?
    I am using the below syntax but it still gives me the default color.
    <htmlb:content design="design2003" >
      <htmlb:page title="test " >
        <htmlb:form>
    <htmlb:tabStrip id         = "TabStrip"
                          bodyHeight = "200"
                          bodyColor  = "red"
                          width      = "700" >
    </htmlb:tabStrip>
    </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    Thanks,
    Sandeep

    Hi...
    The below code is working fine for me...
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title="stg " >
        <htmlb:form>
          <htmlb:tabStrip width      = "430"
                          bodyColor  = "rgb(88,5,64)"
                          id         = "t1"
                          bodyHeight = "112" >
            <htmlb:tabStripItem id      = "t1"
                                index   = "1"
                                title   = "Sales"
                                tooltip = "My Tooltip for Tab 1" >
              <htmlb:textView text="Tab N 1" />
              <htmlb:tree id        = "treeReports"
                          showTitle = "true"
                          table2    = "<%= mt_nodes %>"
                          title     = "Menu"
                          width     = "100%" />
            </htmlb:tabStripItem>
            <htmlb:tabStripItem id      = "t2"
                                index   = "2"
                                title   = "Production"
                                tooltip = "My Tooltip for Tab 2" >
              <htmlb:textView text="Tab N 2" />
            </htmlb:tabStripItem>
          </htmlb:tabStrip>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>

  • Setting Color for Records in forms6i

    Dear All
    How can I set color for particular records on a form. i.e. Set the color of all employees whose salary is greater than 2000 to Red and All the rest to Green
    Solomon

    Hello,
    6i is an old version and I don't remember if there is a Set_Item_Instance_Property() built-in. If yes, you can use it with a Visual Attribute that held the colors.
    Francois

  • 206 unable to set alert only for certain group

    Hi,
    is it a symbian unwanted feature that user is unable to set Nokia 206
    profile to alert for certain group (even though this kind of functionality is
    available on this phone)?
    To be more precise user is able to set profile to alert only for certain
    group but this setting has no effect (phone rebooted, groups recreated, etc. no effect)
    This feature has been available and workin in previous Nokia phones
    since last decace - is it a software quality issue or what.
    Best regards,
    Hez

    It is the Application Pool account making the query to retrieve the groups, so you would need to establish a trust from Domain B -> A.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Maybe you are looking for