A few things wrong with your code. Here's a fixed version
Code:
import java.awt.*;
public class TestWindow
{
public static void main(String []args)
{
CreateWindow();
}
public static void CreateWindow()
{
//create an instance of Window
//the following statement creates an invisible window
Window win = new Window(null);
win.setSize(300,200);
//next we make the window visible.
win.setVisible(true);
}
}
First of all, you wouldn't (normally) create two classes in the same file. You can, but it's not normally done. I've changed your second class to be a method on your first class.
Secondly, the constructor to Window should be passed null if you don't want it to have an owner. And if you want to pass in a variable you don't need to specify the type beforehand (i.e. you would have used just owner, rather than Window owner). And remember you must declare your variables before you use them.
Thirdly, you need to set the size of a window before you will be able to see it.
Fourthly, you don't really want to be using AWT, you should use Swing, and you really don't want to be using a window, a Frame would provide window decorations like scrollbars, a titlebar and a close button at the top.