We're going to begin work on Minibrowse, the next generation web browser and search engine. For this assignment, you will start with the core Minibrowse code and add functionality to display a history window that displays the previous 5 web sites that the user has visited. You will do this by implementing a custom DoubleLinkedList class subject to specifications.
Copy Minibrowse.java to your own directory, compile it, and run it. Type in a URL at the top, and hit Enter to get the web page to render. Enjoy the poor rendering that you see, and appreciate the power of "real" web browsers. Nonetheless, this is a great platform on which we can build. Look carefully at the code to get an understanding of how it works. Try deleting lines or modifying them, and see how it affects your program.
Copy OutputWindow.java to your own directory, compile it, and run it. Look carefully at the code to get an understanding of how it works, keeping in mind that you will eventually use code like this for displaying a user's history. Try deleting lines or modifying them, and see how it affects your program. You will need to use the key combination ctrl-c to quit your program in the terminal window, since I did not set the default close operation to be "exit on close." This is the way your history window should be; you don't want your entire Minibrowse program to shut down when you close the history window.
Create a class called DoubleLinkedList<E> that uses generic types. Use whatever methods you think are appropriate. Your linked list should be doubly linked, i.e. each node in the list should link to the node that follows it and the node that precedes it. You must construct your linked list code "from scratch." You should not use classes from the Java Collections Framework such as LinkedList or other similar classes you may find. This is so that you can gain the valuable experience of constructing a linked list yourself. Once this assignment is complete and turned in, you will be free to use the standard LinkedList class on future homework assignments.
Modify Minibrowse so that it maintains a list of the last 5 web pages that the user has previously visited. Once the list is full, whenever the user goes to a web page you should delete the oldest one and insert the newest one. You should do this efficiently. Do not worry about duplicates; if the user goes to the same web page more than once, add it to the history list more than once.
Add two buttons to the Minibrowse window. A button labeled "History+" should pop open a history window and display the 5 most recent web pages, with the most recent on top and the least recent on the bottom. Another button labeled "History-" should act similarly, but should show the least recent web page on top and the most recent on the bottom. Since your list is linked in both directions, you should not need to resort your data in any way. Instead, you should be able to traverse your list in one direction or the other as necessary.
The changes that you need to make to Minibrowse.java
should be minimal, and just reflect the new user interface
updates. Most of your work will be in the DoubleLinkedList
Have fun!