Suddenly my application has come together and I'm just going through cleaning everything up for submission but I've hit on a problem. The following code is an example
I want to get rid of the margin/inset/padding shown in green in the example screen shot to get the left sides of the text boxes to line up. I've tried adding empty borders and a few other things but can't get rid of it.
Chris Zaremba wrote:I want to get rid of the margin/inset/padding shown in green in the example screen shot to get the left sides of the text boxes to line up. I've tried adding empty borders and a few other things but can't get rid of it.
According to the API, there's a constructor that allows you to specify those gaps:
The API wrote:
FlowLayout(int align, int hgap, int vgap)
Creates a new flow layout manager with the indicated alignment and the indicated horizontal and vertical gaps.
The green margin is actually occurring on topPanel, which has a FlowLayout, not on TestingMargin, which has a GridBagLayout. So importing java.awt.Insets and then specifying
actually has no effect whatsoever on his unwanted space.