This is how a panel with a BorderLayout usually looks :
I dont want to put anything in the center, so the east and west are separated with a space. How to get them attached? If there isn't a way, what other Layout should I use instead? Thank you
You can simply add graphical elements in the desired sections and ignore the others:
add(element1, BorderLayout.WEST);
add(element2, BorderLayout.EAST);
If you want a space in the center, add it explicitly:
add(new JLabel(" "), BorderLayout.CENTER);