So, I have a class Window which extends JFrame, which is the larger window. 

Then I have class MathematicalFunvtions which also extends JFrame, which is the smaller window.
I want to combine them together in another class "Test" so they work together.
public static void main(String args[]) {       
    Window mainwindow;
    mainwindow = new Window();
    mainwindow.setVisible(true);
    MathematicalFunctions functions;
    functions = new MathematicalFunctions(mainwindow);
}
My way to do this is to give a reference of Window object as an argument to MathematicalFunctions and let it do the work.
- Question is... is it a good way of programming things? 
- When I send mainwindow to functions I would like to know inside that object, when main window is moved... so this object can track it and adjust to so they are always together. 
 
    