• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting size of Container

 
Joel Christophel
Ranch Hand
Posts: 250
1
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having trouble setting the size of my Container. From the code below, when I place Container gamePane in a resizable JFrame and expand the frame, the spacing of the gamePane's contents expands to match the size of the frame despite my various attempts to keep the gameFrame at a set size.

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> when I place Container gamePane in a resizable JFrame and expand the frame, the spacing of the gamePane's contents expands to match the size of the frame

if you're adding it via the frame's default layoutManager (BorderLayout), it will always occupy all the space.

couple of ways to do it here

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic