Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Oughtn't Panels add to Frames the way they should?

 
Ranch Hand
Posts: 815
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JOGL involved... move thread if need be... but please to keep reading...
Aight:
Panel GamePanel's got a GLCanvas.
Frame TheGame adds a GamePanel.
Frame TheGame is NOT displaying GLCanvas of GamePanel, as the author of the code wants it to.
?!
also to note: When GamePanel was a Frame (I called it GameFrame!) it worked like a charm. It hasn't retained it's charm�d state through the transition to a Panel. Code can be provided, but I'm figuring the problem itself is fairly generic.
Thank ye Kindly
 
Nick George
Ranch Hand
Posts: 815
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I looked in the AWT section of the forum, and saw this question answered ad infinitum with the solution "set the prefered(that's not spelled right...) size of the canvas, but no one ever said how to do that... i see no setPreferredSize (still doesn't look right). I don't mean to play the dunce, but...
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
by setting the height and width? the getPreferredSize returns a Dimension object, which is basically a combination of height and width anyway.
Try using an absolute layoutmanager and manually set the size of the canvas and see what happens.
 
You may have just won ten million dollars! Or, maybe a tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic