To highlight certain words in the text.

I have a text file and I want to be able to highlight the word "NOT" in the text. Currently, there are 5 words 'NO '.

What field can use to achieve this?

No, you will need two fonts - a normal, another derivative - and your offsets start at 0. Your fonts derived is also false - there is no static Font.derive method:

Font defFont = Font.getDefault();
Font boldFont = defFont.derive(Font.BOLD);
Font[] fonts = { defFont, boldFont };
int offsets[] = { 0, 8, 11, 20, 23, 38 }; // five starting indexes for five regions and one just beyond the whole text
byte[] attributes = { 0, 1, 0, 1, 0 };
richTextField.setText(text, offsets, attributes, fonts);

Tags: BlackBerry Developers

Similar Questions

  • Change the color of specific sets of words in the text indicator

    Hi all

    I try to write my first semi-vaste program. He successfully install drivers and serial for my test steps, which are going well. However, I have problems with creating a nice log window. I am currently using a standard text indicator and messages of PASS/FAIL indicator formatting output.

    Basically my Subvi is trying to determine if the string is SUCCESS or FAILURE and assigns a color on this basis. index and index + 4 (success/failure being 4 letter words) are indicators, that within the MAIN program loop to increase or find the next instance of SUCCESS or FAILURE.

    I took elements of the following resources:

    http://forums.NI.com/T5/LabVIEW/is-there-an-easy-method-for-appending-text-to-a-string-control/m-p/8...

    http://digital.NI.com/public.nsf/allkb/6BD344ACA4DEE20A8625692700737E16

    However, it seems that only a few words (which are not same SUCCESS or FAILURE) are awarded randomly red or green. The second passage, the whole journal is red for some reason any.

    I also tried this in the same line as the indicator of the log window, and in this case, the Word changes color, but whenever a new row is written, everything loses its color and is all black again. I can't seem to find a thread with someone using this exact application. Any help at all would be really appreciated. Thanks in advance!

    Getrich wrote:

    Thanks Steve responding. I'm trying the listbox. I am able to change listItems that you have demonstrated, to have colours. I think that your suggestion to make the color of an entire line is acceptable for my application. Is it possible to implement this in the text box? I built a lot around the use of the text box, and I have to change a little subVIs (or at least add some loops) to implement the text correctly area.

    If you want to use a textbox control, you will probably need to use the approach of the link in your message of moose.

  • When you use my dynamic stamp I get the "undefined" Word where the text entered in the dialog box must be

    I get my dialog box open no problem I enter click data OK but the stamp shows that the text field is "undefined". "Text fields names are 'Due' and 'WorkOrder' in the photo below they appear"DueValue"and WOrkOrderValue", then the results as 'undefined' for both. I put the code at the bottom that I delete the section that caused the word "value" is displayed at the end of the deadline and order of business.

    < AcroForm >

    < ACRO_source > CaseNumField: calculate < / ACRO_source >

    < ACRO_script >

    / * belongs to: AcroForm:CaseNumField: calculate * /.

    var = {} dialog box

    DueValue:

    WorkOrderValue:

    function: Commit (dialog) {/ / called pressed OK}

    results var = dialog.store ();

    This. DueValue = results ["tx1"];

    This. WorkOrderValue = results ["tx2"];

    },

    Description:

    {

    name: 'Information stamp control', / / title of the dialog box

    elements:

    [

    {

    type: "display."

    elements:

    [

    {

    name: "reason: «,»»

    type: 'static_text. "

    },

    {

    item_id: "tx1"

    type: 'edit_text. "

    Multiline: true,

    Width: 200,

    height: 40

    },

    {

    name: "work order #: «,»»

    type: 'static_text. "

    },

    {

    item_id: "tx2"

    type: 'edit_text. "

    Multiline: true,

    Width: 200,

    height: 40

    },

    {

    type: "ok_cancel."

    ok_name: "Ok."

    cancel_name: "Cancel".

    },

    ]

    },

    ]

    }

    };

    If (event.source.forReal & & (event.source.stampName == "#VOfL_5866j3cq0GIzQbaLC"))

    {

    If ('ok' is app.execDialog (dialog))

    {

    CMSG = var dialogue. DueValue;

    Event.Value = "Due\n" + CMSG;

    event.source.source.info.DueValue = CMSG;

    CSMG is "Work Order\n" + dialog box. WorkOrderValue;

    this.getField("WorkOrder").value = CMSG;

    }

    }

    Title of the dialog box get ready unless the code is executed in a context of trust. It's a bit complicated to put up with a custom in a stamp file dialogue box, so I won't even try to explain it.

  • 1 word of the text, 1 colour, missing when gif

    Hello

    I have a PSD file. It has several layers with the same Illustrator file placed at different scales and positions.

    I placed the illustrator file once and duplicated that first mutiple layer before scaling and moving.

    The placed file includes 3 words of text and a vector logo. 1 Word is white.

    I have then open the PSD file in Fireworks and export each layout as a gif by turning the power on and off layers. The text is visible in 4 of the 6 exports. In one the white Word disappears whenever I select gif in "Preview image", it is not just the preview, it does not really save in gif. The gif palette shows no white border color or a lighter. As I said in the only case that one position.

    The layers are all exact replica except for scale.

    I deleted the layer in Phostoshop and made a new one with slightly different scale and position. Same result. I flattened the image in Phostoshop and which opened in Fireworks, same result.

    I saved as a bitmap of Phostoshop picture that opened in Fireworks, same result.

    What could happen to make white disappear just a gif?

    I downloaded the 5 gifs where the word should be visible, as you can see that the word "innocent" appears in 4 of them. In the second she disappears right on voversion to gif format. It is stored as 256 Adaptive that it takes to download in WordPress.

    It is visible in PDF, bmp, png, until what you're converting to gif format. The full PSD file is too big to download here. You can download it here http://gasolicious.com/questions/banners_2160x500.psd

    I use CS6. I have updated to Fireworks, without change. (I also tested in Fireworks CS5 and have the same problem)

    banners_2160x500_B.gif

    banners_2160x500_C.gif

    banners_2160x500_D.gif

    banners_2160x500_E.gif

    banners_2160x500_F.gif

    Post edited by: mgason. Add more images for clarity. Also note the Fireworks 5

    Unfortunately, I could not upload your PSD file successfully. Here are a few ideas:

    • You can save GIFs directly from Photoshop and Illustrator, without need of fireworks (if that helps).
    • Instead of a GIF file, you can try a very similar color format to PNG - 8, indexed.
    • I found that if I had white text selected on the canvas, when I opened a preview image and then played a little with the matte color (change none to white), I might accidentally get the text to disappear. Somehow, my actions were putting text fill to zero within the main interface.
    • I suggest you convert your text to text converted to outlines before exporting, to see if that solves the problem. However, it seems that you are trying a variety of techniques, including flattening of a bitmap, so it cannot help.

    If the GIF palette show you no white or lighter colors, first check the file itself: the white text is still visible? If this is the case, then maybe try manual adding color in the palette of GIF by using the ' Add ' button. Or you could try to save a palette from one of the GIFs and loading in the GIF that gives you problems (there is a drop down for it just above the drop-down list Format).

  • Is there an add-on for Adobe Captivate that allows the word to the text?

    So, I finished my first e-Learning and the customer is happy. They asked:

    (1) can as well an audio version and no sound be downloaded onto a CD?

    (2) can the script be face-to-face facilitation in option. ?

    Well, I did not use a script written for each slide. Is there a tool would you recommend to create the text of the speech?

    Thank you!

    Thank you. I actually ended up using Google Doc w / voice / dictation option. I did the following:

    1. export the audio from Adobe Captivate

    2. set again my sound of "Virtual Audio Cable" settings so that the audio has been accepted by the computer MIc

    3 clip dictated in Google Doc

    There is also a new Google Doc add-on which makes speech text even better that the native Google voice type

    Speech recognition - module Google Docs

  • How to put (Link) certain data of the text block and layer 1 layer 2

    Hi guys...

    I have a block of text that contains 5 element xml, these items showing in the xml of my InDesign file structure,

    above the text, structure is in layer 1.

    I want to put (Link) a given in layer 2 xml element and xml structure shouldn't be change.

    This is the code...

    var doc = app.activeDocument;

    var OnlineLayer = doc.layers.add ({name: 'online'});

    var monnoeud = doc.xmlElements [0].xmlElements [2];

    I want to link myNode element with layer named 'Online'

    Is it Possible, if possible please tell me...

    Thank you...

    Hi guys,.

    It does not work correctly...

    var doc = app.activeDocument;

    var OnlineLayer = doc.layers.add ({name: 'online'});

    var monnoeud = doc.xmlElements [0] .xmlElements [2];

    myFrame var = doc.pages [1].textFrames.add (OnlineLayer);

    myFrame.geometricBounds = [3, 3, 13, -20];

    myNode.placeXML (myFrame);

    myFrame.fit (FitOptions.FRAME_TO_CONTENT);

  • I received a pdf file and the words in the text of the form filled in and saved tabs/forms appears only in the only filed when you click on this field.

    Hi, the text in tabs/forms of the form filled in and saved text doesn't appear when you click on this tab and field offices. When I go to another tab / filed, it disappears. I need to see everything at once.

    Auto-fill text fields is inactivated.  I have acrobat Pro XI / Win764bit. I can't find anything useful in the German speaking forums (there you will find only: save it on your desktop, open the with another program - not adobe, save it as a .jpg, use the preview and save/print pdf, open with photo shop and so forth but nothing works.)

    It would be good to get a link to an old solution or a useful answer.

    Kind regards

    Is there a chance that the application overview on Mac has been used to complete and save the form? What you describe is a typical sign that it was like overview corrupts PDF forms in a number of ways. You can fix this in Acrobat if you have access to a blank form uncorrupted by exporting the form with FDF data and important in the blank form.

  • Set different font sizes for certain parts of the text layer?

    I am a novice as AE is going, but I'm working on a script to dynamically change a project.

    The project in question has a text layer has a single string, but with variable font size (the text is a price, where the hundred part is a smaller font to the different initial values).   I want to use a script to change this text, but it is enough to assign a new text document does not retain the variable formatting - all figures are found with the same font size.

    Since the guide of the script, I see that the size of the font of a text document object is available, but only in a very limited form - definition of value he sets for the entire document, without options to set for a range of characters.  I would be fair to assume that programmatically create/update a document with several sizes of fonts is not possible?

    If this is the case, what would be my best options to achieve the same effect?  If the project is modified to have several layers/documents, is there a way to adjust the positioning to maintain good spacing/kerning between independent channels?  (I'm also a dollar with yet another sign size of police prior to the price, so I would have actually three pieces of text to position in my script and just to the right/left cannot justify two strings).

    Thanks for the tips!

    AFAIK, there isn't a convenient way for a script to maintain several font sizes once it changes a text document.

    You can however, use sourceRectAtTime() to get the actual span of text in a text layer, positioning and three text layers to get the desired spacing is not difficult.

    Dan

  • prohibit certain data in the text of the datetime element

    Hello!

    I am trying to ban the user of the datetime object by entering at the hour of midnight (00:00 MON-DD-YYYY). Basically the user can tab itself out of the text element after inserting the day month and year. I want to make sure he is forced to set the hour and minute also.
    I looked in the property palette but I don't seem to find any with which I can do.

    THX,
    Iulian

    Set

    Field Datatype : DateTime
    Format mask : DD-MON-YYYY HH24:MI
    
    In When-Validate_item Trigger check ...
    If to_char(:date_field ,'HH24:MI') = '00:00' then
      message('Enter Proper time along with date. Not allowed to enter mid-night value or null time ');
       raise form_trigger_failure;
    end if;
    

    concerning
    Dora

  • Dictionary by double clicking on a word in the text don't work at IOS 10

    Since yesterday I installed IOS10 in my iPad Pro, when I read an e-book and I double click on a Word, there is no option. I closed the application and he straightened, closed the iPad and turned back on and the problem persists. In iBooks, the screen looks like not sensitive at all. Little help? Thank you.

    I never did the path of double click. I always slightly pressed a Word to select it, which then pulls up the menu (looks like they changed the definition to look it up). It works for you? By slightly pressing on one word as you would if you start to highlight a line and then let go as soon as the Magnifier window appears?

  • When I print a booklet in word 2010 the text prints really small. Only, it takes 1/4 page and should be 1/2 page. I don't know how to fix it.

    When print my document in booklet form always prints very small text. If small the page takes only 1/4 of page of the book when he should be taken to the top of the opening page of 1/2. I don't know how corect the problem. Any help would be aprisheated.

    You'll have more luck asking experts in the Word 2010 forum.

  • Find not highlight first word of the page

    OK, that makes me crazy. Just a simple user you are looking for a word in a doc. When you use SEARCH, it highlights never the first word found on the page! If I click on find next, it will highlight the next word found on this page if there is one. If there is, I know that somewhere in the foregoing is another instance of the word I was looking for. Otherwise, she will move to the next page with that Word, but even once it is NOT highlighted.

    What happens here?

    This bug has been corrected in Acrobat 9.4.6 update:

    Windows:

    http://www.Adobe.com/support/downloads/detail.jsp?ftpID=5244

    Mac:

    http://www.Adobe.com/support/downloads/detail.jsp?ftpID=5238

  • How to find the word or the text of the geometric limits...

    I have a lot of paragraphs in my document and im searching specific word in my document.

    now, what I want to know is, this particular word limits geometric.

    Try this,

    var  myString = doc.textFrames[i].parentStory.contents;
    var  myText = doc.textFrames[i].parentStory.texts[0];
    
    for(j=0;j		   
  • My photo files are open in the form of files 'Word' in the text and characters. How can I get open like pictures

    I'm sure I've changed a setting, but I don't know where it is how.  Thanking you in advance for the help.

    Hello

    When you double-click a file to open it, Windows XP examines the file name extension. If Windows XP recognize the file name extension, it opens the file in the program that is associated with this file name extension. Try to change the file association and check if it helps.

    (a) right click on the image file.

    (b) click on properties, on the general tab - open with: select Edit.

    (c) select Windows Picture and Fax viewer.

    (d) click on apply and Ok.

    How to change or choose the program that starts when you double-click a file in Windows XP

    http://support.Microsoft.com/kb/307859

  • Windows XP Explorer can perform a file search based on several search criteria? Try to search for files that contain certain words in the content of the file. The basic functionality seems to include the ability Word or a single sentence.

    Search for files using several search criteria.

    Native XP research capacity is quite limited. Try the free Agent Ransack instead. MS - MVP - Elephant Boy computers - don't panic!

Maybe you are looking for

  • No connection to the Instagram puedo hacer en.

    He intentado todo, clear cookies, cache, desactivar extensions clear cache por ficheros if estuviera agents... y en entrar sigo sin poder Instagram. Tambien hay webs donde al dar a descargar UN fichero me lo una pagina in descargarlo vez. Esto ultimo

  • How can I configure Firefox to check if a session is already open before you start a new?

    I have an elderly parent who always dbl_clks desktop icon when he wants to join his social media site, even if he never sold the last of his window he ran. The result is that there soon several windows ff running the same (like 20-30) while Windows a

  • Going, I have a problem with the iPhoto update to pictures?

    I moved my iPhoto library to another internal HD. There are now not there in the folder my pictures on my boot drive. When I switch to El Capitan will that be a problem? I'll do a clean install of El Capitan. Others what precautions should I take? Ma

  • How to move from Windows 95 to 98 or higher?

    I have made several attempts to upgrade and the computer will not charge 98. As the Setup program begins it starts the implementation of Assistant and says "Toshiba Windows 95 Utilities is not compatible with the windows 98 Second edition upgrade. To

  • 15 laptop ac101TU: impossible to select DVD as startup options

    A blue screen appears on my PC saying 'your PC came across a problem. Let's restart for you. " Then my PC can't start saying he needs a recovery such as USB or DVD media. While I ordered a HP recovery kit. During this time, I downloaded the ISO of Wi