Very similar if not exactly the same question from here. I simply remove a JButton from the middle of a row of JButtons and it dissapears but still takes up space! The answer in the attached thread doesn't suit my case, hence not useful to me who doesn't know how to create that new layout. I also tried a flolayout, but the exact same happens.
EDIT
revalidating and repainting worked.