Playing cards on other than a JLayeredPane, or not?
I am sitting on a bunch of code for playing card games. It is all on a JLayeredPane, with stacks of cards in a board area (rows by columns of stacks of cards). Each card image is in a JLabel. The way I originally did it, the window was resized to just the size for the card game to be played, since each variation uses a slightly different amount of space (for variations in how many rows and columns).
Go to maximize the window, which some folks like, and the whole thing is a JLayeredPane with all the card stacks on the top left. I could write code to respond to window size changes, and reposition every stack at that time. Right now, this is something that needs to be attended to.
I also have a "control panel", which has about a dozen swing controls on it, on the pane at right.
I want to add a game "walk-through", where the above panels are contained inside of another that adds a text box and a few navigation controls for making walk-throughs of the game with accompanying narrative. Can I put a JLayeredPane inside of a JLayeredPane? Is there some other kind of pane I could use for stacks of cards that would work allright? I'm wondering if I should just re-calc the positions of things on window resize events, and do everything on one big JLayeredPane... Walk-through, plain game, in any event.
It would be convenient if the "board", which has all the stacks of cards, was on its own panel, and where all the stacks could be placed using x,y coords on the panel. Cards have to move and be placed on top, but I don't have to access cards not on top (of their respective stacks). Is there a non-top-level panel that can do that?
Then, I could have a main window and put that panel at the center of it, with control panel to right, and walk-through stuff on bottom. Also, to use pieces of the overall code, some in a standalone app, some in a partial applet, and place panels various ways. Right now, I'm stuck on an absolute grid for the main window.
TIA and cheers,