I need my buttons to start on 0 on the bottom left corner and go to 99 all the way to the right top corner.. Can you please help me correct my code. Every chage I make to fix it, takes all the buttons lower and I dont need that
private void crear()
{
for (i=0; i<100; i++)
{
btn_boton = new JButton(String.valueOf(i));
btn_boton.setBounds(50+55*(i%10),325+25*(i/10),50,20);
btn_boton.addActionListener(this);
ventana.add(btn_boton);
}
ventana.repaint();
}
Quest Button... and text fields, et
9
8
7
6
5
4
3
2
1
0 10 20 30 40 50 60 70 80 90
Make use of appropriate layouts. Start by having a looking at Laying Out Components Within a Container
The following example makes use of a
GridBagLayout, I do this so I can move from the right to left across the row.