I am trying to access a method from my main class, i have created an object and i can access this method from Main.
But if i then try and access it from another method it cannot be seen and i cannot compile my code.
In public void test() the compiler says "variable Window cannot be found". Obviously this is not supposed to be a variable!
It also has a thin red squigly line under Window (as its an error in Netbeans)
I have stripped the code down to the minimum for clarity on here.
Your Window variable is local to the main() method. Methods can not see local variables declared in other methods. If you want to see a variable from multiple methods, you must declare it at the class level.