Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multithreading & java.lang  RSS feed

 
dinh duong
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have lesson :
Write a program named ProgramExecutor. This program loads information about executable
programs in the text file programs.txt, display on the screen, and enable users to select and run an
outside program.

Sample run:

RUN MY FAVOURITE PROGRAMS

1. Notepad
2. Paint
3. Microsoft Word
4. Microsoft Excel
5. Calculator
6. Internet Explorer
7. Windows Explorer
8. Exit
Run: _


Sample content of the file programs.txt

Notepad, notepad.exe
Paint, panit.exe
Microsoft Word, C:\Program Files\Microsoft Office\OFFICE11\Winword.exe
Microsoft Excel, C:\Program Files\Microsoft Office\OFFICE11\Excel.exe
Calculator, calc.exe
Internet Explorer, iexplore.exe
Windows Explorer, explorer.exe



I don't known how loads information about executable
programs in the text file programs.txt.

Everybody can help me!
Thank so much!
 
Henry Wong
author
Sheriff
Posts: 22846
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't known how loads information about executable
programs in the text file programs.txt.


For info on how to open and extract the program.txt file, take a look at the java.io package (you probably should start with the java.io.FileInputStream class). For info on how to run an executable, take a look at the java.lang.Runtime class.

And BTW, I don't know how this question relates to threads -- perhaps you can elaborate on that?

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!