I created a JPanel of 672x750 and placed a 672x672 image inside it. I need to put texts under the image, in the space left over. Is there any way to create a JLabel and position it below the image? I've tried, but they take up all the space available
public class ContainerDeJanelas extends JFrame {
JLabel infoTotal = new JLabel("Tempo total da batalha (em milissegundos): ");
JLabel infoCasa = new JLabel("Tempo da Batalha em");
JLabel infoDragaoBatalha = new JLabel("Dragões usados na Batalha de");
public ContainerDeJanelas() {
add(new MapaInterface());
setTitle("Heurística Game of Thrones");
//tamanho da tela
setSize(672, 750);
//usuario nao pode redimensionar a tela
//setResizable(false);
add(infoTotal);
add(infoCasa);
add(infoDragaoBatalha);
//evento ao clicar em fechar
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//onde a janela vai aparecer (null = centro)
setLocationRelativeTo(null);
setVisible(true);
}
}
I need infoTotal to be below MapInterface and that infoCasa is below infoTotal. InfoDragao battle has to stay in the lower right corner. Can you do that?