CompSci 308
Fall 2016
Software Design and Implementation

Browser: Understanding GUIs and Events

This classwork is intended to help you to practice creating Graphical User Interfaces, GUIs, including important events, using resources, and styling their appearance.

Another goal is for you to try Pair Programming: working closely with another student and sharing a single computer. To ensure both people try driving, switch the person who types on the primary computer every 10 minutes. You may use a second computer to look up documentation or search the Internet for solutions related to the exercises, but not to do your own work or socialize.

To work on this exercise, fork the original project lab_browser into your own repository so you can edit, commit, and push your group's own changes.

Understand the Design

This code represents a Java solution to create a simple Web Browser as given in this previous assignment from CompSci 101.

This code uses a very basic version of the Model-View (or MV) design architecture.

Add New Features to the GUI

Add the following updates to the View code, calling on code from the Model.

  1. Add two JavaFX components to the method makePreferencesPanel, a Button and a ComboBox, that allow the user to add Favorites (using the Button) and then retrieve them later (using the ComboBox).
    • The Button should create a TextInputDialog box to prompt the user to enter a favorites name for the current web page within the method addFavorite
    • The ComboBox should add a Listener to the ValueProperty that calls the method showFavorite
  2. Change any error messages so that they come from a resource file instead of using hard coded strings.

Add the following updates to the Model code.

  1. Change any error messages so that they come from a resource file instead of using hard coded strings.
  2. Create a custom Exception class, called BrowserException, that is thrown when any kind of error occurs in the Model.

Finally,

  1. Use CSS to change the styling of the entire GUI to something you prefer or something bright and loud.

Submission

At the end of class, use Gitlab's Merge Request to submit your group's refactored code file to the original organization repository. Make sure both people's NetIDs are in the title of your Merge Request.