开发者

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().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜