How can I get the cursor's position in a opened file and display a menu?

Hello,
I want to make a program by which I will be able to display a panel/pops up menu at the corsor's current position, (In any text/doc file or in the desktop, we can display a menu by right click of the mouse.) Now I want my program to do the same task.
More clearly-
1. First I would save some words or sentences in a file(aa.txt).
2. Then I would open another text file/ a word/ excel/ or any other editor( bb.txt / cc.doc / dd.xls / ee.html ).
3. While editing or writing something in the opened file, if I click the right mouse button/ press a key (ctrl+space), a menu will appear containing the sentences I saved in the file(aa.txt) previously.
My program will tell me the cursor's position in bb.txt / cc.doc / dd.xls / ee.html that i opened. And display a menu. my problem is not reading / writing in a file.
My problem is how can I get the cursor's position in a opened file display a menu at that position by a mouse/key action*.
Would you please help me on this regard.
Thanks

DrClap wrote:
I think the OP wants to start up an application like MS Word and then operate it from a Java program.Doesn't The Monkey's Paw do that? What a second, according to Wikipedia:
[http://en.wikipedia.org/wiki/The_Monkey%27s_Paw]
<quote>
...the paw of a dead monkey is a talisman that grants its possessor three wishes, but the wishes come with an enormous price.
The moral of the story is contained in this description of the paw: "It had a spell put on it by an old fakir," said the sergeant-major, "a very holy man. He wanted to show that fate ruled people's lives, and that those who interfered with it did so to their sorrow."
</quote>
So I guess that a non-sequitor ... or is it?

Similar Messages

  • How can I get the same candy crush level on my phone and iPad?

    How can I get the same candy crush level on my phone and iPad?

    The only way to synchronize is connecting to FaceBook. I just set up my girl friend's iPhone to connect with FaceBook, which then updated the phone's level; then I downloaded the app (again) on her iPad and selected connect to Facebook. I'm not sure what the downfall of synchronizing through FaceBook is.... all I can tell you is it worked and now her iPad shows the same level as her iPhone. Good luck!

  • How can I get the cursor to appear in the main search window on the Google home page by default?

    The cursor in my Firefox appears in the address bar. I would like it to appear by default in the main search window on my default home page, Google.com. How?

    This is all very Greek to me. Is it really this hard just to get the cursor to appear in the main search window when Google.com is one's default home page?
    I don't really know much about Firefox extensions. My list includes Adblock Plus 1.3.8; Duplicate This Tab 1.2; Java Console 6.0.25; Java Quick Starter 1.0; Microsoft .NET Framework Assistant 0.0.0; New Tab Homepage 0.4.3. Nothing unusual is indicated for either Java item, Console having been updated 4/27/2011.
    What to do next?
    Thank you.

  • Audio Selection in 3.0: How can I get the cursor to move smoothly?

    I need to be very precise in editing clips in Multitrack View. Right now, the only way I can get the cursor to move smoothly (and not in that herky-jerky motion between zero-crossing points or whatever that it defaults to) is by holding down the CTRL key while using the Hybrid tool. Is there a setting for this somewhere so I don't have to do this every time? Thanks.
    Steve

    Right click on the timescal at the bottom of the waveform display. You will get a drop down box that allows you to change DisplayTime Format, Snapping and Zooming. Go to the Snapping menu and turn on or off those that you want to use.

  • How can I get the apps that I paid for on iTunes and the app store I don't have a computer I paid for them using my ipad and everytime I try to redownload them it asks for my card number and when I put the number in it tells me that the number is not a wo

    Ok can anyone tell how I can get the apps that I paid for on iTunes and the app store using my I pad because I don't have a computer and when I try to redownload the apps it keeps asking me for my card number and when I give it my card info it says that it's an invalid number when I know that it's not

    If you are getting an 'invalid security code' message then is the address on your iTunes account exactly the same (format and spacing etc) as on your credit card bill : http://support.apple.com/kb/TS1646 ? If it is then you could try what it says at the bottom of that page :
    If the issue persists, contact your credit card company and verify that they and any company they use to process credit card authorizations have the correct information on file.
    And/or try contacting iTunes support : http://www.apple.com/support/itunes/contact/ - click on Express Lane, then iTunes > iTunes Store

  • How can I get the context-parm from a web.xml file using struts?

    Hello:
    I need get the context-param from the web.xml file of my web project using struts. I want configurate the jdbc datasource connection pooling here. For example:
    <context-param>
    <param-name>datasource</param-name>
    <param-value>jdbc/formacion</param-value>
    <description>Jdbc datasource</description>
    </context-param>
    and then from any Action class get this parameter.
    Similar using a simple server can be:
    /** Initiates new XServlet */
    public void init(ServletConfig config) throws ServletException {
              for (Enumeration e = config.getInitParameterNames(); e.hasMoreElements();) {
                   System.out.println(e.nextElement());
              super.init(config);
              String str = config.getInitParameter("datasource");
              System.out.println(str);
         public void doPost(HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException {
              // res.setContentType( );
              System.out.println("Got post request in XServlet");
              PrintWriter out = res.getWriter();
              out.println("nada");
              out.flush();
              out.close();
    but only this works for init-params, if I use
    <servlet>
         <servlet-name>MyServlet</servlet-name>
         <display-name>MyServlet</display-name>
         <servlet-class>myExamples.servlet.MyServlet</servlet-class>
         <init-param>
         <param-name>datasource</param-name>
         <param-value>jdbc/formacion</param-value>
    </init-param>
    </servlet>
    inside my web.xml. I need something similar, but using struts inside the action class for that I can get the context-params and call my database.
    Thank you

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • How can I get the cursor value from a waveform graph

     Is there a way to get the value of cursor position on the waveform graph so mathematical calculations be performed on those values. We can see the value in cursor legend, but can we extract those values for future calculations in the block diagram somehow.

    Right-click on the waveform graph icon.  Select Create>Property Node>Cursor>Cursor Position.  That spits out a a xy cluster for the current cursor position.
    If you have more than one cursor, you can either set up a loop and set the Active Cursor property node (right click the property node and select "Change to Write") or you can pull everything you ever wanted to know about every cursor with the Cursor List property node. 

  • How can I get the Airplay to appear on my iPhone 4S and iPad 2?

    I have an iPad 2 and an iPhone 4S, and I have never seen the Airplay button that should appear on each device. I have checked wifi and it seems to works fine for printer and e-readers. Also, I have updated to the latest OS version as of this week. Is it possible to get to appear now? I want to use iPad in my classroom, so I need this feature to function. Thanks!

    The Airplay icon only appears if there's an Airplay enabled device that the iPhone or iPad  can find in the same network, or connected via bluetooth.
    How are you attempting to use Airplay?

  • HT1349 what´s the number serie of the iTunes cards? or how can i get the serie number of an iTunes card? and how can i get information in spanish? HELP!

    Hi!
    i need help, i lost the code of my iTunes card, (it can´t see, it´s illegible) do you know where can i find information in spanish? or how to get the code again?
    it´ll be very helpful your help
    Thanks

    Copy the iTunes folder from the old computer to your new one.

  • How can I get the apple configurator to retain a devices settings and apps?

    Hi there all!
    I have an iPhone that already has apps and email settings on it.  I want to use the configurator to stop the device being paired with anything else not allow it to connect to any other Macs.  I've connected it, backed it up, enabled supervision, then deployed the profile.  Through out all of this I never get the option to restore device settings and when I click on edit stored backups, it contains nothing.  With supervsion disabled I can restore the backup but, snag is to disallow pairing it needs to be supervised.
    Also, am I right in thinking that once it's supervised I can't install any apps directly from the device ?
    Sorry if these are really noddy questions :-)  I just want to stop the device from being able to connect to or pair with anything other than my mac.
    Thanks
    Will

    Jpegs can't have transparent areas. Most likely you had layers and were forced to save "as a copy", which means that the image which remains open in PSE is not the jpg. A file saved as a copy makes a copy in the save format, but it's not like save as where you now see the newly saved version instead of the original. The original remains open and unsaved onscreen.

  • I've changed my Apple ID on my Mac but the old Apple ID shows up when I am trying to download apps. How can I get the new Apple ID on my new Iphone and remove the old ID?

    I changed my Apple ID on my MacBook. My new Iphone5 seems to have my old Apple ID on it. Therefore I can't download apps. How do I 1) remove the old Apple ID on my Iphone and 2) install the new ID on the phone.

    http://support.apple.com/kb/HT1311 Just remember apps that were downloaded with the old Apple ID will be locked to that ID. It will ask for the old ID password when trying to update.

  • IMac stopped recognizing my Internet connection (ethernet) after announcing an IP address conflict (all of a sudden, after 6 years). How can I get the whole network settings part back to default and start over?

    I had no trouble getting on line until last week when a message came on that
    IP address 192.168.0.139
    was in use by
    04:0c:ce:54:c1:e5 
    DHCP Server 192.168.0.1
    Since that time, no matter if I plug it into one router or the other  (I use a router in my office to share the one ethernet cable that comes down the hall) it claims that the ethernet is working and it knows that it is connected to the Internet,but it cannot access the Internet. IT seems to be stuck in a cycle of navel-gazing, constantly focused on its own ethernet IP address.
    All I know how to do is operate the thing; we have no IT person here. A visitor set up our network for us a few years ago. Only the iMac has this problem; my PC laptops go online just fine. But all my work is on the iMac.

    First thing to try is renewing the DHCP lease.
    System Preferences > Network.
    Do you have a green dot next to Ethernet? If so, with ethernet selected in the left pane;
    Check the location is set to 'automatic'
    Check 'configure IPv4' is set to DHCP
    Click the 'Advanced' button
    Check that DHCP is selected in that window for IPv4
    Turn off IPv6 (gives a conflict on some routers)
    Click the button 'renew DHCP lease'
    That should persuade the router to give you a different IP.

  • How can I get the link I click on to open automatically in a new tab? Thank you

    I am sure that the old version of Firefox, you could click on a link and it would open in another tab, I have looked at Google as well, and I can't see if it was a google option.
    Any help appreicated, I expect I am missing the obvious!

    You can use an extension:
    *Tab Utilities Lite: https://addons.mozilla.org/firefox/addon/tab-utilities-lite/
    *Tab Utilities: https://addons.mozilla.org/firefox/addon/tab-utilities/
    *Tab Mix Plus: https://addons.mozilla.org/firefox/addon/tab-mix-plus/

  • How can I get the console Output generated by a exe file

    when I am trying to use method getOutputSteam of Process to gain the outputStream,I got nothing!
    I have also tried to use stream redirect,also no result!
    please help me! Thank you in advance!
    my main code are below:
    Process ps=Runtime.getRuntime().exec("xxx.exe");/*xxx.exe is a executable program which will generate a console with the message I want to gain.*/
    int exitVal= ps.waitFor();
    if(exitVal==0){
    BufferredReader br = new BufferedReader(new InputStreamReader(ps.getInputStream())); String st;
    while((st = br.readLine()) !=null){
    System.out.println("write:"+st);
    }//my result show that I got nothing from the progam.

    ok, this works (I tried) :
    import java.lang.*;
    import java.io.*;
    public class ps {
            public ps() {
            public static void main(String[] args)
                    try
                            Runtime rt=Runtime.getRuntime();
                            Process ps = rt.exec("ps");
                            BufferedReader br = new BufferedReader(new InputStreamReader(ps.getInputStream()));
                            String st;
                            while((st = br.readLine()) !=null){
                                        System.out.println("write:" + st);
                    } catch (Exception e)
                            e.printStackTrace();
    }But it's not the same that a simple ps :
    [host@localhost java]$ ps
    PID TTY TIME CMD
    4065 pts/1 00:00:00 bash
    4319 pts/1 00:00:00 ps
    [host@localhost java]$java ps
    write: PID TTY TIME CMD
    write: 4065 pts/1 00:00:00 bash
    write: 4320 pts/1 00:00:00 java
    write: 4321 pts/1 00:00:00 java
    write: 4322 pts/1 00:00:00 java
    write: 4323 pts/1 00:00:00 java
    write: 4324 pts/1 00:00:00 java
    write: 4325 pts/1 00:00:00 java
    write: 4326 pts/1 00:00:00 java
    write: 4327 pts/1 00:00:00 java
    write: 4328 pts/1 00:00:00 java
    write: 4329 pts/1 00:00:00 java
    write: 4330 pts/1 00:00:00 java
    write: 4331 pts/1 00:00:00 ps
    write: 4332 pts/1 00:00:00 java
    write: 4333 pts/1 00:00:00 java
    [paul@localhost java]$
    And I don't know why...

  • How can I get a cursor position?

    Hi Everyone!
    In my TextArea, there is a blinking cursor.
    How can I get the cursor position not the mouse position.
    Thanks,

    Thanks JefferyGong!
    That is selection index number, not the coordinate point.
    I want to know point position.
    Gyi

Maybe you are looking for