• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Multithreading & java.lang

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
author
Posts: 23931
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic