May I know how can I determine whether a component is found in JPanel?
boolean isThisComponentFoundInJPanel(Component c)
{
Component[] components = jPanel.getComponents();
for (Component component : components) {
if (c== component) {
return true;
}
}
return false;
}
Using loop is not efficient. Is there any better way?