How to count number of controls like JTextField, J Label and so on so..in java swing form designing,for example if we use only one textbox and one text field means i need the o
As they should all be inside your Container object you can use the getComponentCount() method to return you an int of the number of components.
Container
getComponentCount()
int
Container c; int count; count = c.getComponentCount();