but it won't compile because it requires some parent "Component" object. I think maybe I need to create AWT somehow. But I know nothing about AWT.

So if someone could please show me some code that can open a file from the file system from a regular java class then it would help me a lot.

Actually I would prefer to use the Windows Open File Dialog but I suspect that is more difficult to do. But if you know how to use that instead of JFileChooser then feel free to demonstrate that approach. Otherwise I would be happy to know how JFileChooser works.