hi guy i would like help or info about socket

little exemple of code:

clientSocket = new Socket(ip, 6784);
BufferedReader insideServer = new BufferedReader(
new InputStreamReader(clientSocket.getInputStream()));

its that possible from the inputStream getting the click event ?

example a user click from a button and another user using same application
on another computer receive data from that button.

it's hard how to explain what i am looking for but
i extends a new jbutton and redefine with new parameter and i want to get those value when that person click.

this my new button i want the x y

class MyButton extends JButton implements ActionListener {   
       int x, y;

   MyButton(String text, int x, int y) {
      super(text);
      this.x = x;
      this.y = y;
      addActionListener(this);
   }

   public void ActionPerform(ActionEvent e) {

   }
}

i understood what you are looking for i.e you need a form which sends and receives a data using socket programing

is this right?

we can do this thing by using Socket class (for sending data) and ServerSocket class (for receiving data)

but i have some doubts in your post

its that possible from the inputStream getting the click event

i couldn't understand what you are asking in the above line can you clarify this?

and in the given Mybutton Class you have taken x,y parameters

can you tell me the use of those variables?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.