I'm trying to make a java program(Windows.java) that can start a JInternalFrame and have its contents to be a different program(Calc.java). I could say
where Life returns a JPanel. However, I don't want to hard code the name Life in because I want it to be able to run any java program I have. Right now, I store the Program I want displayed in a .txt file. Then I extract the names from each line and turn them into buttons. Before, I just ran "cmd.exe /c start java -cp \"C:\\J\" " + choices[choice-1]", But I dont want to start a new window, just an internal Frame. Is there any way to do this? Maybe some way to have the program name stored in to string choice and say choice a = new choice() where choice is any program name?
JInternalFrame frame = new JInternalFrame("Life", true, true, true, false);
Double post to "AWT/Swing" http://www.java-forums.org/awt-swing...rame-help.html
You could try using Reflection.
Trail: The Reflection API (The Java™ Tutorials)
Be aware that it has a fairly steep learning curve.
Thanks for the help. I got it working. Also, thank you for introducing reflections to me. I never knew java could do that. I thought when I asked if you could make a class name a var, people would just say, "not possible". Thanks again.