GridLayout doesn't take the component as a parameter so this situation can't happen. Same for GridBagLayout. I'm think other Layout Managers are the same way (these are the two main layouts I use).
...
Type: Posts; User: helloworld922
GridLayout doesn't take the component as a parameter so this situation can't happen. Same for GridBagLayout. I'm think other Layout Managers are the same way (these are the two main layouts I use).
...
Your confusion is probably due to the way Java manages object references.
Initially, gameModePanel points to some panel (or more likely, null).
In the first example, you pass that old panel (or...