views:

30

answers:

2

I am making a card game atm, and i want the card stack to be placed in the middle of a Jframe. Right now i have made the cardstack in a layeredPane. And that layeredPane is placed in a panel. And i want that panel to be placed in the midle of the frame, or the contentpanepanel....

Please help guys...

I dont want more sleepless nights :D

+1  A: 

If you set the layout of the containing panel to GridBagLayout and set the preferred size for the inner panel to your desired size, the inner panel should center itself within the outer panel.

P.S. I've open sourced some card game related libraries that may have some code that is useful to you.

Arnold Spence
Nice apps you have made, and thanks for the quick answer :) i will look at it later today, and hopefully get it to work :)
Kasper
A: 

i have made the cardstack in a layeredPane.

You might find the Overlap Layout helpfull.

camickr
Oh, now that's cool.
Arnold Spence