Java Reference
In-Depth Information
*17.19
(
View hex
) Write a program that prompts the user to enter a file name, reads bytes
from the file, and displays each byte's hex representation. (
Hint
: You can first
convert the byte value into an 8-bit string, then convert the bit string into a two-
digit hex string.)
**17.20
(
Binary editor
) Write a GUI application that lets the user enter a file name in the
text field and press the
Enter
key to display its binary representation in a text area.
The user can also modify the binary code and save it back to the file, as shown in
FigureĀ 17.23a.
(a)
(b)
F
IGURE
17.23
The programs enable the user to manipulate the contents of the file in (a) binary and (b) hex.
**17.21
(
Hex editor
) Write a GUI application that lets the user enter a file name in the
text field and press the
Enter
key to display its hex representation in a text area.
The user can also modify the hex code and save it back to the file, as shown in
FigureĀ 17.23b.
Search WWH ::
Custom Search