Who can explain a referencing detail?
I have the following code which adds a JPanel named analysePanel to a JTabbedPane (plotsPane). The "analysePanel" is newly initiated at every iteration and another JPanel is added to it.
for (int i = 0; i < tabDescription.length; i++){
JPanel p1 =new JPanel();
p1.add(new JLabel(tabDescription[i]+" Analyse"));
analysePanel =new EmptyAnalysePanel();
analysePanel.setLayout(new BorderLayout());
analysePanel.add(p1);
plotsPane.add(tabDescription[i],analysePanel);
}
Now why do the Tabs in the tabbedPane contain different panels (that's obviously what I want in the end but I wonder why it is so) and not all the same? Why don't they all have a reference to "analysePanel and display the same thing, the current configuration of "analysePanel?

