I have an assignment that involves making a command provider through system.out and system.in. Im kinda stuck because my application needs to be able to open other application (notepad, cmd, etc.) and I have accomplished that but the application needs to be able to run multiple processes at once, thats where I get stuck because when I run a application like notepad my command provider which I feed commands in order to run applications, stops responding.
Basicly here�s how I do it:
So when I type: run notepad. A notepad runs with empty txt file, but if I type: run notepad c:\myDocument.txt it opens notepad and loads the given text file.
How do I run multiple instances of f.ex notepad? I�ve tried using threads but it ain�t quite working.
Can you show us your threading code that didn't work, please?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
When you call run() directly it acts just like any other function. What you really need is to create a new thread and run it, and you use the start() method for that.
I figured it out, I was referring to the array program that wasn�t in the run() methods scope so I got NullPointerException. Thanks for the help though.
There's a city wid manhunt for this tiny ad:
Gift giving made easy with the permaculture playing cards