I started making a small dictionary app for practice but i'm stuck at
the very beginning . I just don't know how to reduce the space between the
Container and the first Component that i add, the more i resize the
window the space is larger. I tried setting the weightx and weighty
constraints, but still no change. Any help?
I'v attached the source code and screenshot.
I want the JTextField component to be the first in right after the window bar with a very small amount of space.
To add space around a component use the ipadx and ipady values.
Having said that, using GridBagLayout for such a simple problem seems like an over kill to me. Have you looked at the Box container which uses BoxLayout and has methods for adding fixed size invisible components (struts).