• Post Reply Bookmark Topic Watch Topic
  • New Topic

Student's Questions  RSS feed

 
James Chegwidden
Author
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Move to the appropriate forum... if needed.
Question:
We were finishing GUI chapter in Java recently. One of my Java students asked the following questions. Since some of you have been at this longer than I have and use Java daily, what are your answers.
1. In what situations should you use a JFrame rather than a JPanel?
2. What benefits are there to a JFrame?

Thanks answers appreciated.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JFrame is an outer Container and as such it extends Window and has all the cool stuff that Windows have. You can not put a Frame in a Panel.
A Panel is an inner Container and does not have the bells and whistles. You can not have a Panel as an outer Container. Of course Applet is the exception to this, but then an Applet is intended to run with the browser itself as the outer container.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!