Ok, so I've been stuck for a little while now on this problem. I'm trying to pass an array of Tabs and I'm just not doing it correctly. I believe I'm missing something simple, because I need to learn more about what is happening with my code rather than just going through the motions.
Here's my code.
public class CountProg extends Canvas {
private Tab[] incTabs;
public CountProg()
{
super();
//some code
tabSet.addTab((Tab) getTabs()[0]);
}
public Tab[] getTabs()
{
return incTabs;
}
public void setTabs(Tab[] incTabs)
{
this.incTabs=incTabs;
}
}
public class stCountTest extends CountProg {
private StaffMain _sm;
public stCountTest(StaffMain sm,String permission)
{
super();
_sm=sm;
setTabs(createTabs());
init();
}
public Tab[] createTabs()
{
Tab[] temp = new Tab[]{
new Tab("One"),
new Tab("Two"),
new Tab("Three")
};
return temp;
}
}
I know the problem is with my set and get methods but I just cant figure out precisely what it is.
If I create and array of tabs in the getTabs() method and return it, everything works fine.
I appreciate any help, thank you.