Ok so lets say I have 3 Jpanels - 1 parent and 2 Children
//Assume necessary imports etc
parent is something like:
public class ParentPanel extends JFrame {
private JPanel mainPanel,controlPanel;
public ParentPanel(){
MainPanel pp= new ParentPanel();
controlPanel cp = new controlPanel();
}
...
Main Panel in real thing is like a 2d graphics thing but not important for the point so simplified:
public class MainPanel implements MouseMotionListener{
public MainPanel(){
//not important now
}
public void MouseMoved(MouseEvent arg0){
int xPos e.getX
}
...
What i want to do is get the X pos of the mouse and pass it from main panel up to the parent and into a label for example on the sibling control panel.
Any ideas clues or pointers appreciated thanks