Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6579011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:50:40+00:00 2026-05-25T15:50:40+00:00

I made a java program just for fun this program allows you to control

  • 0

I made a java program just for fun this program allows you to control the seconds computer mouse using the first computer’s mouse. so everytime the mouse moves some the x and the y of the cursor is sent client application. which then uses the robot class to move the mouse. right now I am using sockets to communicate and it is really slow what is a better way to do it any help would be apritited. if possible please provide some code
thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:50:40+00:00Added an answer on May 25, 2026 at 3:50 pm

    If both applications live in different virtual machines, then communication via sockets is a very good approach.

    If it is too slow, you may consider

    • using UDP protocol instead of TCP/IP
    • look at you server/client code, performance may be killed there.

    Considering you comment to this answer:

    As you send bytes over sockets, performance will be increased if you encode the mouse positions to byte values rather then to String:

    int x = getX();
    int y = getY();
    // let's assume we have a 16Bit / 2Byte range for both values (practica)
    byte[] message = new byte[4];
    message[0] = (byte) (x >> 8) & 0xff;
    message[1] = (byte) x & 0xff;
    message[2] = (byte) (y >> 8) & 0xff;
    message[3] = (byte) y & 0xff;
    sendViaSocket(message);
    

    (It starts and ends with some magic, the point is the encoding)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am new to java and i just made my first program: HelloWorld and
I'm just starting Java ... again. I just made a simple program class first
I made a Java program that runs on a computer with two RS-232 ports.
Possible Duplicate: How do I create an .exe for a Java program? I've just
I want my program, a Java executable .jar, to be run just once. I
I'm a beginner in programming. I've just made a program called Guessing Game. And
I have made a program in Java which is used to collect medical data
I have made a program in Java that calculates powers of two, but it
So I have this Java project made up of several classes, some external JAR
I've made a Java program I would like to make available to people of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.