I have the following output.
Recursive call for org.jfree.chart.ChartPanel[chartpanelBoa
Component count 0 for org.jfree.chart.ChartPanel[chartpanelBoa
The code i run to get this output is
public void enableEverything(Container c){
Component [] p = c.getComponents();
System.out.println("Component count " + c.getComponentCount() + " for " +
c.toString().substring(0,40) );
for(Component pp : p){
pp.setEnabled(true);
if(pp instanceof Container){
System.out.println("Recursive call for " + pp.toString().substring(0,40));
enableEverything((Container) pp);
}
else System.out.println("No recursive call");
}
}
The ChartPanel can be be seen in my JPanel, however it wont count the chartpanel. I am expecting an output of
Component count 1 for org.jfree.chart.ChartPanel[chartpanelBoa
What sits behind the scenes that counts the component?