Thank you for your reply 
I plan to use different classes for different GUI components for my game later on, since my game needs things like cards, tokens, dices and so on,
but what i want is i just want to see two screens sync-ing when i drag 
here’s my rubbish code 
import java.awt.Component;
import java.awt.Cursor;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Scanner;
import java.net.*;
import java.awt.Color;
import javax.swing.SwingConstants;
public class Drag extends JFrame {
private JLabel lblNewLabel = null;
private JLabel lblNewlabel1 = null;
private InputStream is = null;
private OutputStream os = null;
private PrintWriter out = null;
private Scanner input = null;
private JPanel contentPane;
private boolean drag;
private int x;
private int y;
/**
* Create the frame.
*/
public Drag() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
lblNewLabel = new JLabel("New label");
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel.setBackground(Color.RED);
lblNewLabel.setOpaque(true);
lblNewLabel.setBounds(29, 61, 96, 70);
contentPane.add(lblNewLabel);
lblNewlabel1 = new JLabel("New label1");
lblNewlabel1.setHorizontalAlignment(SwingConstants.CENTER);
lblNewlabel1.setBackground(Color.RED);
lblNewlabel1.setOpaque(true);
lblNewlabel1.setBounds(199, 61, 96, 70);
contentPane.add(lblNewlabel1);
lblNewLabel.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
if (e.getSource() == lblNewLabel) {
drag = true;
x = e.getX();
y = e.getY();
}
}
@Override
public void mouseReleased(MouseEvent e) {
drag = false;
}
@Override
public void mouseEntered(MouseEvent e) {
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
@Override
public void mouseExited(MouseEvent e) {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
});
lblNewLabel.addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseDragged(MouseEvent e) {
if (drag) {
if (e.getSource() == lblNewLabel) {
Component c = (Component) e.getSource();
int X = c.getX() + e.getX();
int Y = c.getY() + e.getY();
//lblNewLabel.setLocation(c.getX() + e.getX() - x, c.getY() + e.getY()- y);
String s = "lblNewLabel" + "/"
+ Integer.toString((X - x))
+ "/"
+ Integer.toString(Y - y);
out.println(s);
}
}
}
});
lblNewlabel1.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
if (e.getSource() == lblNewlabel1) {
drag = true;
x = e.getX();
y = e.getY();
}
}
@Override
public void mouseReleased(MouseEvent e) {
drag = false;
}
@Override
public void mouseEntered(MouseEvent e) {
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
@Override
public void mouseExited(MouseEvent e) {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
});
lblNewlabel1.addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseDragged(MouseEvent e) {
if (drag) {
if (e.getSource() == lblNewlabel1) {
Component c = (Component) e.getSource();
// String s = "lblNewLabel1" + "/"
// + Integer.toString((c.getX() + e.getX() - x))
// + "/"
// + Integer.toString(c.getY() + e.getY() - y);
out.println("lblNewLabel1" + "/" + Integer.toString((c.getX() + e.getX() - x)) + "/" + Integer.toString((c.getY()+e.getY() - y)));
// c.setLocation(c.getX() + e.getX() - x, c.getY() + e.getY()- y);
}
}
}
});
}
/**
* Launch the application.
*/
public static void main(String[] args) {
Drag frame = new Drag();
frame.setVisible(true);
frame.run();
}
private void run() {
try {
Socket socket = new Socket("localhost", 55555);
InputStream inStream = socket.getInputStream();
OutputStream outStream = socket.getOutputStream();
input = new Scanner(inStream);
out = new PrintWriter(outStream, true);
while (true) {
String line = input.nextLine();
String[] parts = line.split("/");
String parts0 = parts[0];
String parts1 = parts[1];
String parts2 = parts[2];
int x = Integer.parseInt(parts1);
int y = Integer.parseInt(parts2);
if (parts0.equals("lblNewLabel1"))
lblNewlabel1.setLocation(x, y);
if (parts0.equals("lblNewLabel"))
lblNewLabel.setLocation(x, y);
}
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}