Can't quite see why you would use a JLayeredPane
for this, but that's just me.
Set the Layout
for the main container to BorderLayout
. Add the boardX
to the BorderLayout.CENTER
position of the main container.
Add the player information panel to the BorderLayout.EAST
position of the main container.
Setting the bounds
of the boardX
is not really going to have any effect, as the parent container will want to use the panels preferred/minimum/maximum size (based on whatever layout manager you might use) to determine the best size to make it, which based on your code, would probably be 500x500 anyway...