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.
- Add two JavaFX components to the method
makePreferencesPanel
, aButton
and aComboBox
, that allow the user to add Favorites (using theButton
) and then retrieve them later (using theComboBox
). - The
Button
should create aTextInputDialog
box to prompt the user to enter a favorites name for the current web page within the methodaddFavorite
- The
ComboBox
should add aListener
to theValueProperty
that calls the methodshowFavorite
- 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.
- Change any error messages so that they come from a resource file instead of using hard coded strings.
- Create a custom
Exception
class, calledBrowserException
, that is thrown when any kind of error occurs in the Model.
Finally,
- 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.