Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: Java Program that Runs in Background

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Java Program that Runs in Background

    How to write a java program that can run in background but still can detect any key press (with the corresponding key code)?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Java Program that Runs in Background

    The program would need the focus to get the key press.
    You would need JNI code for this app.

  3. #3
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Java Program that Runs in Background

    What are you trying to achieve? Are you trying to write a keylogger?

  4. #4
    Junior Member
    Join Date
    Aug 2011
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Java Program that Runs in Background

    Yes I am trying to write keylogger. Any suggestion

  5. #5
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Java Program that Runs in Background

    I am trying to write keylogger. Any suggestion
    Java's the wrong tool for the job. You need low-level access to the keyboard driver for your platform. Why can't you use a freely available (some are open-source) 3rd party keylogger?

  6. #6
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Java Program that Runs in Background

    Hey guys I want to write a virus in Java, can you tell me how to do that?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    Forum Squatter newbie's Avatar
    Join Date
    Nov 2010
    Location
    North Wales
    Posts
    661
    My Mood
    Stressed
    Thanks
    28
    Thanked 115 Times in 106 Posts
    Blog Entries
    1

    Default Re: Java Program that Runs in Background

    Quote Originally Posted by KevinWorkman View Post
    Hey guys I want to write a virus in Java, can you tell me how to do that?
    Oh Oh! Yeah I want to know too! PM me when you've written in guys, I'll be playing minesweeper till then.
    Please use [highlight=Java]//code goes here...[/highlight] tags when posting your code

  8. #8
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Java Program that Runs in Background

    Quote Originally Posted by KevinWorkman View Post
    Hey guys I want to write a virus in Java, can you tell me how to do that?
    My suspicion as well, although I was thinking more along the lines of spyware - which isn't something many of us would like to see the forums have a hand in. Of course this could all be legit, but its up to the original poster to prove so.
    Last edited by copeg; September 15th, 2011 at 02:12 PM.

Similar Threads

  1. Program Runs in Eclipse but Not When Exported
    By Pantheon8 in forum Java IDEs
    Replies: 2
    Last Post: August 17th, 2011, 05:57 PM
  2. Shortcut executed or in-background running Java application
    By xixixao in forum Java Theory & Questions
    Replies: 2
    Last Post: April 22nd, 2011, 04:33 AM
  3. Blackjack program runs excrutiatingly slow.
    By sina12345 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: December 10th, 2010, 04:55 AM
  4. How to schedule a Java Program for Background processing
    By rangarajank in forum Java Theory & Questions
    Replies: 5
    Last Post: May 13th, 2010, 03:57 AM
  5. runs once only
    By silverspoon34 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 21st, 2009, 03:31 AM