GridLayout. Check the amount of cells used
After creating the grill with "GridLayout":
supper(new GridLayout(rows, column));
I will add to demand content in开发者_如何学JAVA each cell:
public void addButton(String name) {
buttons = new JButton(name);
add(buttons);
}
As I can I know the current number of cells used to keep a counter of addition and deletion?.
Thanks.
You could check with Container.getComponentCount()
.
精彩评论