The JWindow is a top-level container, but without any embellishments like minimis/maximise buttons. It can be used straight against the desktop, but you usually use JFrame instead.
The JPanel is a rather featureless space which has to go inside something else eg a JWindow, JFrame, JScrollPane, or even another JPanel. You can use the JPanel either to add other components inside, or as a blank space for drawing on with a Graphics object. You cannot use JPanel against the desktop.