Say for e.g.
My java application lies in C:\myProject
I have
D:\stuff\TestPlayer.java
D:\stuff\ComputerPlayerInterface.java
now from my application dir, how could i load an instance of TestPlayer?
but the above code means that TestPlayer has to be in C:\myProject but i want to get this working to create an instance of TestPlayer with it being in a different folderCode:Class c = Class.forName("TestPlayer"); ComputerPlayerInterface o = (ComputerPlayerInterface) c.newInstance();
Class c = Class.forName("D:\stuff\TestPlayer") does not work.
any ideas guys, is this even possible, without editing TestPlayer.java or ComputerPlayerInterface.java?




Reply With Quote