How To Implement Find Option

Hello frnds,
I am working on a project whose aim is to make an editor completely in java. But i m unable to implement feature like Find.
Please suggest me how to implement this.
Thnx

if your editor is a jtextarea, i would suggest something like that:
String textTyped = textarea.getText();
String lookForText = new JOptionPane.showInputDialog("text you look for?");
int indexOfTheText = textTyped.indexOf(lookForText);
textArea.moveCaretPosition(indexOfTheText);maybe the instruction to focus on the caret after the caret move is missing here
just try :)

Similar Messages

  • How to implement Find & Replace

    Hello,
    I have a mini editor based on a JEditorPane. How can I implement find & replace function visually, like any editor does?

    Hi there,
    the latest stage of SimplyHTML implements find & replace. You can find all (app, docs, sources) at http://www.lightdev.com/template.php4?id=3
    A screen shot for the find & replace dialog it implements:
    http://www.lightdev.com/template.php4?id=34
    Online documentation for find and replace
    http://www.lightdev.com/doc/shtm/rel/help/topic16/topic173.htm
    Manual as PDF file (see chapter 'Inside SimplyHTML' -> 'Stage 11: Find & Replace')
    http://www.lightdev.com/doc/shtm/rel/Help.pdf
    API docs (including find & replace functions)
    http://www.lightdev.com/doc/shtm/rel/api/index.html
    Have fun
    Ulrich

  • How to implement "Undo" option using acrobat SDK

    Hello,
         I want to implement "Undo" option in my application which will restore last modified data.
         I am reffering to acrobat 7.0 SDK. I am trying with AVUndo functions from SDK.
         I am not getting basic thing to start the implementation.
         Please suggest me a way for implementation of "Undo" option.
    Thanks in advance.

    Look at the Stamper sample. It also demonstrates use of the AVUndo API.

  • How to implement find methods in CMP?

    As OC4J does not support EJB-QL, we need to implement the find methods by ourselves. But how? Here is my thought.
    1) Still declare the find methods in EJB home, such as
    public Collection findBySponsor(String sponsorGuid);
    2) Do not add query part to ejb-jar.xml file;
    3) In the bean class, implement the find method using JDBC code.
    Does CMP allows explicit-implementation of finder methds?
    Does CMP allows explicit-call to JDBC code?
    Thanks,

    Henry -- Why go to that trouble? For the near term I would suggest that you just modify the generated
    orion-ejb-jar.xml descriptors which will include tags to allow you to either 1) enter a partial criteria or
    2) enter a complete SQL statement. This is much less work and when EJB-QL is available with the product,
    then you have to only add the EJB-QL to the ejb-jar.xml.
    Thanks -- Jeff

  • How do I find optional languages in Pages 5.0? In Pages 4.3 you used to select a language via Inspector.

    Pages 5.0 does not appear to offer the possibility of selecting a language. This really is a shortcoming when you have pre- and post-reform versions of a language, as in German. Am I missing something? in Pages 4.3. you would make a slection via the Inspector.

    Pages now uses  Edit > Spelling and Grammar > Show Spelling and Grammar to set the spell check dictionary.
    If you have been using dictionaries beyond what Apple provides, you may have to reinstall them in Mavericks if they are no longer present on the list, and how well they will work with Pages 5 you will have to check.
    If it doesn't meet your needs, you can stay with Pages 4.

  • How to use Find option not Filter in my webdynpro app

    Hi,
         I have a table which displays data extracted from R/3 System.
    Now if i want to see a particular number record how to do that with out using Right and Left arrows of table.
    Here i tried by using filters..but i want to enter the record Number not the data of the record.
    Can anyone please let me know how to do this...
    Thanks and regards,
    Chandrashekar.

    Hi,
    Add a search button to your table toolbar. Onclick of that you can take the user to the specified record entered in the input field. Add this inputField also to your toolbar.
    Add the following lines of code to your search button event:
    if(wdContext.nodeSearchRec().currentSearchRecElement().getSearch() == null){
              wdComponentAPI.getMessageManager().reportException("Please enter a record Id",false);
    else { 
    int leadSelect = wdContext.nodeSearchRec().currentSearchRecElement().getSearch();
    wdContext.nodeEmployee.setLeadSelection(leadSelect);
    where node SearchRec.Search is the attribute bound to your search inputField.
    And nodeEmployee is the datasource of your table.
    If you have any further queries, you can come back to me.
    thanks & regrads,
    Manoj
    Message was edited by:
    Manoj
            Manoj Kumar

  • How does Tree Finder creates the BPEL flow tree - using ORABPEL schema

    I want to understand how does Tree Finder option on BPEL console gets the BPEL flow tree displayed ? How does the references to further BPEL processe instances get stored w.r.t the current BPEL process instance ? Which tables in ORABPEL schema are involved or store such references ?
    Basically, I wish to get a similar tree given a BPEL instance id in my code. Pls help.
    Analysis Done:
    if I see the audit trail of the BPEl instance, it gives me an XML with multiple nodes having wikey and partnerWSDL elements. Does this partnerWSDL holds the key here ?
    wikey="10011-BpInv0-BpSeq0.3-2"
    wikey=<cikey>-<node_id>-<scope_id> [orabpel.WORK_ITEM]
    Thanks.

    Is it based on root_id/parent_id column in orabpel.CUBE_INSTANCE ?

  • How can i find the option to delete a recent print job from the "View Job History

    1. Photosmart 5510 e-ALL-IN-ONE SERIES
    2. Window 7 64 bit
    How can i find the option to delete a recent print job from the "View Job History

    Hello alfmswongg,
    Currently there is no option to delete print jobs from the "View Job History" section of ePrintCenter.  
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

  • How do I find my tab history? I had hard drive issues and when I launched my browser after getting it back their was no "restore session" option. I know a tab history is kept, just don't remember where or how to exercise it. Thanks

    Question
    How do I find my tab history? I had hard drive issues and when I launched my browser after getting it back their was no "restore session" option. I know a tab history is kept, just don't remember where or how to exercise it. Thanks

    Firefox 4 saves the previous session automatically, so there is no longer need for the dialog asking if you want to save the current session.<br />
    Use "File > Exit" or "Firefox > Exit" if you want to restore multiple windows.<br />
    You can use "Firefox > History > Restore Previous Session" to get the previous session at any time.<br />
    There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.
    Another possibility is to use:
    * [http://kb.mozillazine.org/Menu_differences Firefox (Tools) > Options] > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"

  • How do I find out what HD upgrade options are compatible with my MBP?

    I'd like to upgrade the 250GB hard drive in my Macbook Pro to a 500GB or larger size.
    A copy of the Hardware Overview is pasted below to illustrate the specifications of what I have right now.
    How do I find out what drives are compatible with my machine?
    What, if any, are the options for buying something off-the-shelf at a retail outlet?
    Hardware Overview
    Model Name:          MacBook Pro
      Model Identifier:          MacBookPro3,1
      Processor Name:          Intel Core 2 Duo
      Processor Speed:          2.2 GHz
      Number of Processors:          1
      Total Number of Cores:          2
      L2 Cache:          4 MB
      Memory:          4 GB
      Bus Speed:          800 MHz
      Boot ROM Version:          MBP31.0070.B07
      SMC Version (system):          1.16f11
      Serial Number (system):          W8******XAH
      Hardware UUID:          00000000-0000-1000-8000-001EC20738B2
      Sudden Motion Sensor:
      State:          Enabled
    Serial-ATA Device Tree
    Intel ICH8-M AHCI:
       Vendor:          Intel
      Product:          ICH8-M AHCI
      Link Speed:          1.5 Gigabit
      Negotiated Link Speed:          1.5 Gigabit
      Description:          AHCI Version 1.10 Supported
    FUJITSU MHY2250BH:
                    Capacity:          250.06 GB (250,059,350,016 bytes)
      Model:          FUJITSU MHY2250BH                      
      Revision:          0081000D
      Serial Number:                  K43******RL2
      Native Command Queuing:          Yes
      Queue Depth:          32
      Removable Media:          No
      Detachable Drive:          No
      BSD Name:          disk0
      Medium Type:          Rotational
      Partition Map Type:          GPT (GUID Partition Table)
      S.M.A.R.T. status:          Verified
      Volumes:
    disk0s1:
      Capacity:          209.7 MB (209,715,200 bytes)
      BSD Name:          disk0s1
      Content:          EFI
    Macintosh HD:
      Capacity:          249.2 GB (249,199,591,424 bytes)
      Available:          82.45 GB (82,445,946,880 bytes)
      Writable:          Yes
      File System:          Journaled HFS+
      BSD Name:          disk0s2
      Mount Point:          /
      Content:          Apple_HFS
    Recovery HD:
      Capacity:          650 MB (650,002,432 bytes)
      BSD Name:          disk0s3
      Content:          Apple_Boot
    <Serial Number Edited by Host>

    I got the hard drive upgrade kit and now have the old drive in the On-The-Go-Pro external enclosure and the new drive in the Macbook Pro. I booted from the old drive and now I'm ready to restore to the new drive using Disk Utility but I'm not sure exactly what to select as the Source and Destination.
    Three disks are listed in the left frame. The new Samsung disk, the old drive in the OTGPro external enclosure with a volume called "Macintosh HD" and something called "disk 2" with a volume of Mac OS X Base System under it.
    I think I should select "Macintosh HD" as the source and the Samsung Drive as the destination. But I'm not certain.
    What's the correct source and destination?

  • How do I find out if Keep Itunes Media Folder Organized option is enabled programtically

    How do I find out if Keep Itunes Media Folder Organized option is enabled on Windows. My Java application needs to know this because it effects how it should interact with iTunes and last time I looked the api provided by the iTunes.dll doesnt provide this information.
    I have made some progress looking at iTunesPrefs.xml which stores preferences in a binary plist format and have mananged to extract the location of the iTunes xml file using a Java library called dd-plist
    public File getITunesXMLFile()
            System.getProperties().list(System.out);
            String homedir = System.getProperty("user.home");
            File prefsFile = new File(homedir,"AppData/Roaming/Apple Computer/iTunes/iTunesPrefs.xml");
            File xmlFile;
            try
                NSDictionary rootDict = (NSDictionary) PropertyListParser.parse(prefsFile);
                NSDictionary userPrefs = (NSDictionary) rootDict.objectForKey("User Preferences");
                if(userPrefs!=null)
                    NSData iTunesLocation = (NSData) userPrefs.objectForKey("iTunes Library XML Location:1");
                    if(iTunesLocation!=null)
                        String base64 = iTunesLocation.getBase64EncodedData();
                        String filepath = new String(Base64.decodeBase64(base64),"UTF-16LE");
                        xmlFile = new File(filepath);
                        System.out.println(filepath+":File Exists:"+xmlFile.exists());
                        if (xmlFile.exists())
                            return xmlFile;
            catch(Exception ex)
                ex.printStackTrace();
                //Use default then
                xmlFile = new File(homedir + "/Music/iTunes/iTunes Music Library.xml");
                if (xmlFile.exists())
                    return xmlFile;
            return null;
    However the Keep Itunes Media Folder Organized option appears to be stored in the Documents:132 key with other options and this library doesnt seem able to decode the daat into a  base64encoded value. I did think I could just compare differences between the file after enabling/disabling the option in iTunes, but the results are inconclusive - sometimes after chnaging the option the preferences file doesnt seem to change.
    Is there a known hack for this ?

    Thanks that certainly a possible workaround that I can see working but Im not that keen on using a users file as a test file, or adding a file myself that I have to keep deleting.
    The thing is I'm very close, I've found a library that can read the binary xml format to some degree, and managed to decode the Xml Library File sucessfullly (but I don't need to this as available as the in the COM lib anyway as itunes.getLibraryXMLPath())
    but I cannot decode this option whihc is lumped in with others, real shame they dont provide it via the COM lib.
    Added this link showing progress in case interested:
    http://stackoverflow.com/questions/17957433/how-can-i-work-out-if-ituneskeep-itu nes-folder-organized-is-set-programmaticall

  • I am trying to export my bookmarks to an HTML file, but the "organize" option does not appear when I click on the "bookmarks" option on the menu bar. How can I find the organize option?

    How can I find the "organize" option or export my bookmarks to HTML when no "organize" option appears when I click on the "bookmarks" word on the menu bar?

    Menu changed to show "Show All Bookmarks" see item #7 "Menu changes (wording)" in
    You can make Firefox 4.0.1 look like Firefox 3.6.17, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 look like 3.6)]

  • HT5312 the forgot security answers option does not show up how do i find the answers

    the forgot security answers option does not show up how do i find the answers

    You need to contact Apple, either through the link in that article or by phoning them.
    (77185)

  • HOW CAN I CUSTOMIZE THE FIND OPTION OF A LOV

    1. Can anybody tell me how can i customize the find option of a LOV....
    2. Is it possible to add more then one find option in a LOV
    HOW??????????????????????
    Can you help me...............

    no chance with the default-LOV.
    You have to create a similliar control on your own.

  • How can we find the exit being implemented in a project.

    Hello,
    Very Good morning!
    How to find the impelementd exit for a given transaction
    How can we find the exit being implemented in a project and to find it's source code?
    Any Suggestions would be appreciated...
    Regards,
    Kittu

    Hi,
    Ways to find the exit triggering in the source code:
    1)first way
    1) If you hav that FM exit that was listed r used.
    2) go to se37 and type that FM
    3) In the source code of that FM double click the type of Message or
    exit result which has the Z<include>.
    4)IN order to disable the exit->
    utilities->system->sattus->program->attributes->package
    find this package
    5) in SMOD->Prject->F4help->giuve package name-give the found ones
    But here we cant see the implementation.
    2) second way
    1)goto SE37
    2)Give FM name
    3)/h(Debugging on)
    4) Display
    5) Break points->statements->(messages if used in exit)->execute
    Click on f5 until that Exit is triggered
    6) go and find out for each type of exit message shown ie til that exit functionality is
    actually triggered
    7)once u find that exit ur looking for->
    8)GOTO->SOURCECODE->give the include name that is found in debugging when exit is encountered
    9)copy this include name(ZX..)->keep a comment forthat exit in this include(ZX..) inorder not to process.
    10) se38->Zincludename(ZX..) and comment the code.
    11)save check n activate
    ->SE37->
    FM->name
    we can now view FM.
    3) third way
    1)FM->Name
    2)/H
    3)Break point at CALL CUSTOMER-FUNCTION statement
    4) It will stop at this exit.
    Reward if helpful.
    Best Wishes,
    Chandralekha

Maybe you are looking for