I have a panel with GridLayout(1, 3) but i want centralize the content of cells in this layout(without addition Panels):
public MainMenu() {
setLayout(new GridLayout(1, 3));
setBorder(BorderFactory.createLineBorder(Color.BLUE));
setOpaque(false);
ImageComponent img = new ImageComponent("resources/music.png", true, this);
add(img);
ImageComponent img1 = new ImageComponent("resources/video.png", true, this);
add(img1);
ImageComponent img2 = new ImageComponent("resources/audio", true, this);
add(img2);
}
Because if i just add this 3 ImageComponents to MainMenu they appears upwards.