JFrame and JPanel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rpm27
    New Member
    • Jan 2008
    • 23

    JFrame and JPanel

    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.
  • BigDaddyLH
    Recognized Expert Top Contributor
    • Dec 2007
    • 1216

    #2
    Read the discussion at the beginning to the documentation for JFrame:

    Comment

    Working...