2
I created a 672x750 Jpanel and put a 672x672 image inside it. I need to put texts under the image, in the space that remains. Is there any way to create a Jlabel and position it below the image? I tried, but they take up all available space
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 stay below Mapainterface and infoCasa to stay below infoTotal. Infodragao battle has to stay in the bottom right corner. It has how to do this?
Which layout manager are you using? Add a [mcve] so you can reproduce the problem.
– user28595