I'm new to Java. I am starting to understand Java GUI dimension (the swing library), and I need someone to clarify something to me: As far as I know, JFrame objects provide a window (with the maximize, minimize, close buttons, and a title bar), and JPanel provide a space for graphics, however they both are containers and can contain other JComponents (Buttons...). My question is, in what case should I add my components directly to a JPanel object, and when directly to a JFrame object. And since they are both containers, could I add a JFrame object to a JPanel object? what result will it give? Thank you.