I have specific classes that i need to load. There name are stored in a String array. I can load the specific classes, but i can't manipulate proprely.
String [] myClassesList = {"Class1", "Class2", "Class3"...};
FileClassLoader loader = new FileClassLoader("MyClassesPath");
Class [] c = new java.lang.Class[myClassesList.length];
for(int i=0; i<myClassesList.length; i++){
c[i]=loader.loadClass (myClassesList[i]);
... //This work proprely
}
but i can't
c[i] myNewCi = new c[i].<constructor>();
Note: All my classes are extended JPanel. I need to add to a jTabbedPane. I'm trying to do the following code.
...
myPanelClass myPanel = new myPanelClass();
jTabbedPane1.addTab("myPanelName", myPanel);
... //This work proprely
Any feedback would help. Thanks!