This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JWindow and JFrame  RSS feed

 
Pawanpreet Singh
Ranch Hand
Posts: 264
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody,

What is the main difference between JWindow and JPanel?
 
Campbell Ritchie
Sheriff
Posts: 55329
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!