This week's book giveaway is in the Security forum.
We're giving away four copies of Securing DevOps and have Julien Vehent on-line!
See this thread for details.
Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

swing  RSS feed

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm confuse.....
when i want to create a swing app, i have a choice from few choices...
i have, JPanel, JFrame, JWindow etc...
what is the different between all this...
when i tried all, it seem, all the same....
help!....
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ariffin,
Maybe from a programming standpoint they are the same but visually they are VERY different!
JPanel is a generic container for any components. It has no decorations and is not controlled by the Windowing environment.
An Applet is a subclass of JPanel, therefore it is the same thing with some extensions to work with browsers.
JWindow is a container that is controlled by the Windowing environment but has no decorations (title bars, resize handles, system buttons, etc).
JFrame is a container that is controlled by the Windowing environment and has all required decorations to look like a system window. This is usually the choice for java applications that require windows.
JDialog is a container that is controlled by the Windowing environemnt and some required decorations to look like a system window. JDialogs are handy for input and can be made modal (blocks until dismissed).
Each choice has its own pros and cons. Since you are just starting use JFrame for an application and JApplet for an applet. Leave the others for more advanced stages of your programming career.
Regards,
Manfred.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!