DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Suggestions required for solving a Java problem.

  1. #1
    Join Date
    Jul 2007

    Suggestions required for solving a Java problem.

    Respected Members,
    I am working on a project from quite some time, during this time I have consulted different books, web sites, posted various messages on various forums but still unable to get the solution, actually the solution which I am aiming should be purely Java based, below I am first stating the scenario and than my questions, I would be waiting for replies from your side, please give me suggestions that how to make this thing possible and please help me finding some pure Java solution to this problem(if a pure java solution) exists), following is the scenario:


    I want to make a Java application which is continuously running in memory, by “continuously running in memory” I mean that when ever I start my PC the application starts running at the back end just like a Windows Service without any user intervention and when the PC is closed the application will off course stops working like all other windows services. Now what this application has to do is to continuously monitoring all the key strokes pressed from the keyboard by the user, when ever a user presses Ctrl-F3 ( pressing Control key and F3 keys together) than a pop up message will appear on the screen but if the user presses some other key or a combination of different key strokes than nothing will happen. This is the complete scenario which I am facing, now the questions which I have are as follows:


    1) How can I trap an event ( any particular key press event) from a Java program which is running in the windows service, handling key board events for a GUI based forms is quite simple but how can I trap an event for such a program, how can I bind my key press events to this program.
    2) My second question is that how to add a Java program to a windows service so that every time I start my PC my program like all other services also starts running.
    3) Last but not the least that I need a pure Java based solution, is this really possible and if not than what are the other ways to solve this scenario.

    Thanking You in advance.

  2. #2
    Join Date
    Mar 2004
    Question 1, there is no way that I know of using pure java without using JNI to access other Windows libraries. In java, the only way to capture keystrokes that I know of is to have a component have the current focus.

    Question 2, Do a google search for "run java application as a windows service". I found various links that you may want to take a look at.

Similar Threads

  1. Java 3D to 2D applet problem
    By nataku in forum Java
    Replies: 0
    Last Post: 04-27-2006, 05:29 PM
  2. Multiple Java Financial NYC Job Openings
    By Recruitermd in forum Careers
    Replies: 0
    Last Post: 03-24-2005, 03:53 PM
  3. Has Sun Given Up on the Desktop?
    By Lori Piquet in forum Talk to the Editors
    Replies: 114
    Last Post: 10-10-2002, 06:01 AM
  4. Replies: 0
    Last Post: 02-01-2002, 12:08 AM
  5. Replies: 4
    Last Post: 10-20-2000, 02:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center