Require a Java Swing GUI program that opens a file as a binary stream and then displays the values of each byte in Hex and as readable text.
The program should have a reasonable GUI including the title “Binary File Viewer”
The program should display the name of the file being viewed.
The program should use a Swing TextArea to display the file using the specified format below. This should allow the user to scroll back and forth through the entire file.
The program should include a New button that allows the user to enter the name of the file to view. Use the java file picker dialog for this. Be sure to code it so that it will recover from errors and not simply terminate the program.
The program should include a Quit button.
Assume that your program will read the entire file into memory and create the display content within the textArea.
Make sure that the program closes any opened files especially when the user exits the program.
Required Display format:
16 Byte values displayed as 2 digit hex values separated by 2 spaces, then a separator | and then the text representation of these same characters. For the text representation, use a period or dot for non-printing characters (like a carriage return) and just display the printable ones.
Here is an example of what you should display:
AD EF 00 10 46 56 23 50 AD EF 00 10 46 56 23 50 |..aBntefg.?>..
AD EF 00 10 46 56 23 50 AD EF 00 10 46 56 23 50 |..aBntefg.?>..
AD EF 00 10 46 56 23 50 AD EF 00 10 46 56 23 50 |..aBntefg.?>..
AD EF 00 10 46 56 23 50 AD EF 00 10 46 56 23 50 |..aBntefg.?>..
…
Display at least 16 lines of output, unless the file you are viewing is shorter than that.
To be clear, there are 16 characters to the right of the | separator which correspond directly to the 16 hex byte codes on the left. So, looking at the example above the first byte has the value of AD and the first character to the left of the | separator is the printable character that has that same code or is a period if that value is not printable. (I did not bother to look up the codes for the example so it only shows the format, not the actual text characters for the hex bytes values but your program will.)
Note that the program should be exactly formatted like this. Each Hex byte should be 2 hex digits with two spaces between each byte. Do not put spaces between the text representation characters on the right side of the separator.
Notes:
You will want to use the JFileChooser Swing component to implement the open file dialog for the file viewer. There are some issues when the user enters the forward slash \ as the directory separator because java will interpret it as the escape character. You can fix this by searching though the file string and either replacing the forward slash with a backslash / or inserting an extra forward slash \\.
Insure that each byte has two digits. This means that you may have to append the leading zero for a value like 0A = 10 in dec.
The program has to compile of course and I require the source code. Thank you.
The code should be adequately commented. If you utilize shared code, please reference credit to the author, in the comments.
No problem, expert in the Java Language here. I am well versed not only in Java but JavaME as well. Java Swing and Java Applets are also a speciality of mine as well as database interaction with Java.
I have basically already built what you are asking for, as a part of a tool I am developing for another project. I can easily adapt the code I've already written to create your project in no time. I am an experienced Java developer and I am well qualified to do this project. Serious bidder, let me know if you're interested.
Hi, I am a Sun certified Java Programmer and have 3 yrs of industry experience with extensive work done in Java/J2EE and Swing.
I assure you well documented code with inherent mainatainablity
Hi, I have good experience in Java Swings, I have done Layout designing for a complex GUI application which can run irrespective of the screen resolution, for queries please contact 9032229384