Java 4
Java 4
HOMEWORK #4
PART A
1 Create a program that prompts the user to enter a line of text and saves each
alternate word into the file “AltInputs.txt”
2 Write a program to read a text file “MyFile.txt” and print the first letter of each line
of text in it.
3 Write a program to demonstrate the life cycle of an applet. Each life-cycle method
must output its name on the screen console when invoked.
PART B
5 Create an applet to display “Hello” wherever the mouse button is clicked on the
applet canvas.
6 Design a closable window using Swing/AWT components to input details of a user such
as Name (using Text Field), Age (using Password Field), Gender (using Radio Buttons),
and Remarks (using Text Area) and a Save Button which when clicked saves user
entered information into a disk file.