This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating a Window with JPanels

 
Mabel Ahmad
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So far I am only able to create a window with my current constuctor. I would also like to add a few JPanels that I have created onto it but they are not showing up. Can someone please help me? Thank you!


 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your UserInterface constructor appears to be in the wrong order.
setVisible(true) should be moved to the last line of the constructor

although not a big problem, it would be less confusing (to others)
if you set the layout prior to adding the components.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic