0

I made a basic launcher with some buttons but I was wondering of there was anyway that I could run the game when I press a button and pull the console to be printed in a text area on the launcher? I have no experience with any launchers or anything and I want to make it totally by myself and not using any builders or anything.

Edit: i don't just Want to run a program with another program. i also want to intercept/ take the console from the one i start running and put it into a text area.

DusterTheFirst
  • 317
  • 1
  • 4
  • 15
  • 1
    You mean you want to launch a 3rd party program? You might want to do some research into `ProcessBuilder` – MadProgrammer May 07 '16 at 00:04
  • i want to launch another jar file – DusterTheFirst May 07 '16 at 00:05
  • 1
    Well, that would depend, is the jar file currently in the classpath or do you need to load it? If you need to load then you need to do some research into custom classloading, if it's already in the classpath (and you code is compiled against it) then you just need to instantiate the required class and call it's methods – MadProgrammer May 07 '16 at 00:09
  • 1) `JTextArea txtrConsole = new JTextArea();` should be more like `JTextArea txtrConsole = new JTextArea(5,20); // suggest a size` while `GameLauncher.setBounds(100, 100, 450, 300);` should be `GameLauncher.pack();` after all components are added. 2) Please learn common Java nomenclature (naming conventions - e.g. `EachWordUpperCaseClass`, `firstWordLowerCaseMethod()`, `firstWordLowerCaseAttribute` unless it is an `UPPER_CASE_CONSTANT`) and use it consistently. 3) Please use code formatting for code and code snippets, .. – Andrew Thompson May 07 '16 at 00:23
  • .. structured documents like HTML/XML or input/output. To do that, select the text and **click the `{}` button** at the top of the message posting/editing form. – Andrew Thompson May 07 '16 at 00:23
  • i just used the frame builder and i just want it to be simple – DusterTheFirst May 07 '16 at 10:19
  • and i am using the border layout so it can be resized – DusterTheFirst May 07 '16 at 10:22

0 Answers0