I suppose you basically want to read the lines of a text file and use them as options in an awt Choice object? Then you should use the BufferedReader, FileInputStream and InputStreamReader classes, part of java.io:
BuffferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("[path\]<textfilename>.txt")));
Use the readLine() function of BufferedReader object to read lines from the file using a while loop, and add them as choices to the choice list, represented by the class Choice(part of java.awt).
You also need to know about ActionListener to respond to a button click, and about ItemListener to respond to selection of a choice in a choice list, and about WindowAdapter to close a window.
The complete code is attached below:
P.S.:And I need to know a lot more about Layout Managers.
Edited by Ritwik I the programmer, 27 March 2013 - 12:08 AM.