Use a combination of weightx
and anchor
on the delete icon.
For example, try using weightx = 1
and anchor = GridBagConstraints.WEST
. Note, this will also push the other content to the left.
You could also try using weightx = 1
on the comment panel instead.
You may also find better use of gridwidth
and cell placement allows you to overlap components across columns which will give you a better result.
Don't forget to reset the constraints before you use them on the next component.