This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Oughtn't Panels add to Frames the way they should? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Oughtn Watch "Oughtn New topic
Author

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

Nick George
Ranch Hand

Joined: Apr 04, 2004
Posts: 815
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


I've heard it takes forever to grow a woman from the ground
Nick George
Ranch Hand

Joined: Apr 04, 2004
Posts: 815
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...
Maarten Vergouwen
Ranch Hand

Joined: Jan 12, 2004
Posts: 60
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.
 
 
subject: Oughtn't Panels add to Frames the way they should?
 
Similar Threads
Extending JPanel and Focus
Why does the FlowLayoutManager layout more space than needed?
JScrollPane intermittently fails to display JPanel contents - gray panel instead
addNotify not called
First off, an apology to those that moderate this forum