public class Excel01 extends JFrame{
public static JTable table = new JTable();
public Excel01() {
table.addMouseListener(new MouseListener().........
}
class PopUp extends JPopupMenu.....
class SharedListSelectionHandler implements ListSelectionListener
public static void main(String[] args) {
Excel01 ex = new Excel01();
ObjectOutputStream oos = new ObjectOutputStream(soc.getOutputStream());
oos.writeObject(obj);
}
}
I did not include the whole code. but I will explain what I did. as you see I create the class "Excel01" with JFrame extension.
and I made this Excel01 as Object file. and send it to the client whoever connected to my Server.
My question is 1. on client side. pop-up Jtable was successful. and also Server's data but Excel01's table's mouse click event setting was not working on client side.
I'm not really sure what this ObjectoutputStream outputting. If I want to send my mouse event what do I have to do?
It looks like you are dramatically over-burdening yourself with way too many concepts that have nothing to do with each other.
If you intend to make any progress, you need to dissect those things into the real parts in there:
In other words: you should step back and first learn about these different concepts that you intend to use. And then, when you understand the parts, try to use them to solve your problem.
It seems that you want to tell your "server" about something that the client does. Then the answer is not to give the server "the same UI components" and send mouse events there. Then the answer is clearly define the "data" the client is interacting with; and the potential actions one can perform using this client.
And then you define a distinct protocol between client and server; for example some way to send "commands" from the client to the server. The server receives commands, and does something about that.
Example: