Fill Entire Cell With Two Components Using MigLayout

I have two components which I would like to both fill the same cell in a MigLayout:

For example, I want to give both components constraints something like this:

cell 0 0 1 1, push, grow

and have them both be placed exactly over top of one another inside cell 0 0

(If I just use the code above, they end up sharing space side-by-side in the cell)

What do I have to add to the MigLayout constraints to make this happen?

Answers


I ended up solving the issue by giving the first component an id in MigLayout:

cell 0 0 1 1, push, grow, id myid

Then explicitly positioned the second component on top of the first using the first component's bounds (referenced using the id):

pos myid.x myid.y myid.x2 myid.y2


Place them in a panel with CardLayout and swap when necessary.


Need Your Help

regenerate_session_id destroying session information

php session

I have an application that needs to create a new session id at specific times. Right now, this is causing the user to log out because $_SESSION ends up being empty.

Question about URL Validation with Regex

regex url

I have the following regex that does a great job matching urls: