I have the following code :
JTabbedPane container;
...
AWindow page = WinUtils.buildWindow();
boolean existing = checkIfExists(page); // in this code, this will always be false
if(!existing)
{
String tabName = page.getLoadedFileLocation().getName();
container.addTab(page.getLoadedFileLocation().getName(), page);
}
Component comp = container.getTabComponentAt(0);
int sel = container.getSelectedIndex();
container.setSelectedComponent(page);
the thing is :
container.getTabComponentAt(0)
returns null
. The other weird thing is :
container.getSelectedIndex()
returns 0
. The logical thing that I think should happen, is to have a reference to the created window. Why am I receiving null
? What am I doing wrong?