• Post Reply Bookmark Topic Watch Topic
  • New Topic

Do JPanels use lots of overhead?

 
Sarone Thach
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am just weighting out whether I should use lots of JPanels to help me layout my GUIs, or spend alot of time trying to use less JPanels to achieve the same result. I'm trying to save time, as there are more to programming than mucking around with layout managers. And at the moment I have such a big problem with layout managers. I was told to use more JPanels to help, but I keep thinking there are actully alot of overhead for JPanels. Am I right or wrong?
Any thoughts on this.
Thanks.
Sarone
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're mostly wrong. JPanels are "lightweight components" meaning they have no native peer component, just a Java object. It's an object with a few dozen member variables, so they're not free, but they're maybe 100 bytes or so, certainly less than 200 all told.
 
Sarone Thach
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very useful information, thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!